Operating System - HP-UX
1819681 Members
3522 Online
109605 Solutions
New Discussion юеВ

DNS setting (resolv.conf) change without reboot

 

DNS setting (resolv.conf) change without reboot


Dear all,

I need to change the DNS nameserver parameters in the resolv.conf file on my HP-UX 11 boxes, as our DNS server IP address is changing.

I expect that any changes to resolv.conf will not be in effect immediately, but is there a way to tell HP-UX to reload/reread the resolv.conf file (something like inetd -c) without having to reboot the box?

Thanks in advance

/Michael
4 REPLIES 4
Jeff_Traigle
Honored Contributor

Re: DNS setting (resolv.conf) change without reboot

Changes are immediate. No need to reboot or restart or reload anything.
--
Jeff Traigle

Re: DNS setting (resolv.conf) change without reboot



Thanks, thats good news :o)

/Michael
Geoff Wild
Honored Contributor

Re: DNS setting (resolv.conf) change without reboot

Yes, change is immediate.

Also, as a tip, you can add these settings:

retrans 2500
retry 2


That means server will only try a dns server twice - if it doesn't respond, then it will go to the next one.

man resolv.conf for more info.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
rick jones
Honored Contributor

Re: DNS setting (resolv.conf) change without reboot

Certainly, and newly created processes will see the changes in resolv.conf. In the past at least, and perhaps this has changed, processes which had already performed name/address lookups would have cached the DNS server information and would not consule resolv.conf again.

So, it wasn't necessary to _reboot_ to have the change take effect, but it could be necessary to restart certain long-lived processes.

One way to test the hpothesis would be to write your own long-lived process. Have it make a getaddrinfo() call (because everyone should have migrated off of gethostbyname by now) and then go to sleep for a while. Then change the resolve.conf file and see if when the process wakes-up and tries another getaddrinfo() call if it rereads resolve.conf - you can do that with the tusc system call trace utility - you should see open/read of resolve.conf and then if a long-lived process is going to see changes, either another arbitrary open/read of resolv.conf, or a stat() of it.
there is no rest for the wicked yet the virtuous have no pillows