Set Server Host Name

0

I wan't to publish my hostname so that I can access the server from anywhere I want. How can I possibly implement this in golang?

This can be related to defining java.rmi.sever.hostname to my IP address, does golang support this kind of binding?

Karan Gurnani

Posted 2013-04-28T16:25:46.600

Reputation: 61

How do you expect two different programs running on the same host to resolve the situation when each of them wants to set a different hostname? – jnml – 2013-04-28T16:49:34.973

I don't have such kind of scenario. I just have a single server which will accept connections and server requests. If the server is running on, say, my PC at home then I want to access the server from, say, my work place. I can only access it when I'm on the same network that the server is, apparently. But I'm looking for ways in which it can be accessed across the network, if there is one. – Karan Gurnani – 2013-04-28T17:33:26.690

Weird that your question got moved from stackoverflow to superuser. That doesn't make any sense. What is this? Wikipedia? – Ask Bjørn Hansen – 2014-01-15T10:01:41.993

Answers

2

If you want to publish your hostname to DNS you can use a dynamic DNS update to an appropriately configured server with miekg's dns package. If you use dyndns then there's a dyndns go client, too, that you probably can adapt to be part of your program.

If you just want to publicize your service on the local network, then at least for Linux and OS X (including iOS) clients you can do it with multicast dns.

Ask Bjørn Hansen

Posted 2013-04-28T16:25:46.600

Reputation: 391