Need help with Hosting my own "Master Server" Server for multiplayer in unity5

I’ve been looking around the forums and I’ve been trying (and failing) to make this masterserver function in unity5 and make a GUI “Server list” similar to this.

My method for “multiplayer” is having all “dedicated servers” (running though either a java application or another unity scene) and “Ad-Hoc servers” (where the client can also act as the server for LAN and online) all register to a “masterserver” (like in the screenshot). I host the masterserver and all it does is maintain a list of all the registered servers. (Like a phonebook).

When a player “connects” to a dedicated or Ad-Hoc server, the player really connects directly to whatever server the player want’s to connect to.

If anybody can help me out with making such a thing, without relying on Unity’s beta Multiplayer (I’m calling it beta because it has yet to work for me) and I don’t want to use Photon because I can’t host it myself or freely give servers to other people (like in the screenshot).

You can write your own master server using .NET sockets, really easy. Use Sockets to send and receive data over TCP - .NET | Microsoft Learn

You can also use gamesparks NoSQL functionality, that is very easy as well.

I used both methods in the past with good results, I switched to steam since I have an appID now. You could also use a webserver too.

Just a little more info, essentially all it boils down to is:

Game servers need to send their data (IP, Port, players, map, etc) to master server.
Clients request server list from master server.
Master server sends servers details to client (json is nice for this)
Client parses data from master server and displays it in server browser.

Many different ways to do it, no right or wrong way really.