1

I follow the instructions in https://askubuntu.com/questions/87665/how-do-i-change-the-hostname-without-a-restart. The host name is changed correctly when I verify using "hostname".

However, there is one issue. Since I only change the host name but not IP address. I continue to test using "nslookup ip_addr", where "ip_addr" is the IP address of the machine. The nslookup still returns the old host name.

Is there any way (without reboot) to let nslookup also return the new host name?

Thanks a lot.

After reboot, nslookup returns the new host name. So in my networking context, DNS performs setting automatically. But I don't want to reboot.

user180574
  • 225
  • 1
  • 3
  • 12

1 Answers1

3

nslookup is using your DNS server, not your local hostname configuration, to resolve the IP to a name.

You'll need to make that change in your DNS server, which depends on how your DNS server gets updated - maybe manually, maybe automatically on reboot of the host, maybe through some other automated mechanism.

Shane Madden
  • 114,520
  • 13
  • 181
  • 251
  • Please check my new edit. The purpose of changing hostname is for others to access. If just changing locally, that would be less meaningful. If there is something performed during reboot, what is it and can I do it too? – user180574 Dec 04 '14 at 20:50
  • @user180574 In that case, it's *definitely* a DNS thing, remote systems accessing the local system don't care what the hostname is set to locally, it's all DNS. You need to determine what populates your DNS server and how updates are done there in order to be able to make the changes you want to make. – Shane Madden Dec 04 '14 at 20:52
  • I found that just restarting network interface helps. Thanks. – user180574 Dec 04 '14 at 20:52
  • @user180574 In windows I would tell you an ipconfig /registerdns, in linux maybe that http://www.tek-tips.com/viewthread.cfm?qid=1065754 – yagmoth555 Dec 05 '14 at 02:47