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.

closed as off-topic by yoonix, mdpc, Katherine Villyard, HopelessN00b Dec 5 '14 at 0:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – HopelessN00b
If this question can be reworded to fit the rules in the help center, please edit the question.

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.

  • 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 4 '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 4 '14 at 20:52
  • I found that just restarting network interface helps. Thanks. – user180574 Dec 4 '14 at 20:52
  • @user180574 In windows I would tell you an ipconfig /registerdns, in linux maybe that tek-tips.com/viewthread.cfm?qid=1065754 – yagmoth555 Dec 5 '14 at 2:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.