Building a master server so people can host their own dedicated servers is not a hard task. Once you have setup a tcp/ip or udp server / client structure, you will need 2 basic things:
The idea of a heartbeat system is easy. A dedicated server hosted by players sends a heartbeat (just a packet with information) to the master server every x seconds, with basic information about the server (server ip, server port, server version, current amount of players, maximum amount of players, server-side variables such as game speed, game mode etc). The server will save this information in the server structure, for example a List of Server(class) objects.
Request list of servers: Once a player opens the client, it will send a packet to the server containing a command to request the server list. The master server then sends back a serialized list of all the servers that have sent a heartbeat in the last x seconds. This way you always have a up-to date list of all the player-hosted servers.
Also you should have a timer which deletes servers from the master server which have not sent a heartbeat for for example a minute.