System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

After change IPs and hostname of DNS server

SOLVED
Go to solution
Gary L
Super Advisor

After change IPs and hostname of DNS server

Hi

I have changed the IPs and hosts name of DNS servers on all of our HP-UX servers and Linux servers by modified configure files /etc/resolv.conf.

After DNS change, some servers didn't work properly, they still looking for the old DNS IPs and hostanmes. I need manually to flush DNS cache on Linux servers. But on HP-UX server, there is no cache for DNS, right?

Someone said, after DNS change, we need restart some processes to make the change take effect without system reboot. What's the processes and how to retart?

Someone said there is daemon pwgrd on HP-UX the same like Linux/solaris's nscd, we need run pwgrd to do some thing like "flush the DNS cache". If so, how? Just # /usr/sbin/pwgrd?

I know, this kind of question has been asked here so many times, but so far I didn't find a answer to fit my case. I don't wanna reboot server.


Thanks a lot. Any answers will be very appreciate.

-GL
12 REPLIES
TTr
Honored Contributor
Solution

Re: After change IPs and hostname of DNS server

> some servers didn't work properly, they still looking for the old DNS IPs and hostanmes

What exactly is failing or what is looking for the old server? Did you try a nslookup to some name/IP that are in the DNS tables?

I am not aware of DNS caching at the OS level when it comes to DNS clients, it is always a lookup. It is possible that you have a running application that has made a lookup when it started up and it is still using the name/IP of that first lookup. If that's the case you have to restart the application.
Gary L
Super Advisor

Re: After change IPs and hostname of DNS server

Hi TTr

Thanks a lot for your fast reply.

For the error "not work properly, still look for old DNS servers", I got this alert from our network support team, they sent me a bunch list of not working properly servers, some are linux servers and some a HP-UX servers. I have fished the linux server part via flush DNS cache by restart nscd daemond. But have no idea how to fix the problem on HP-UX servers. In ITRC, lots of people said, if you change the IPs of DNS server by modify /etc/resolv.conf, you have to restart some processes to make the change work. But they didn't mentiond which processes need be restarted and how?

-GL
TTr
Honored Contributor

Re: After change IPs and hostname of DNS server

You have to get some details as to what is not working and start troubleshooting. At the OS level run nslookup tests to verify that the resolver is working.
Gary L
Super Advisor

Re: After change IPs and hostname of DNS server

Hi TTr

You don't know which processes/daemond need be restarted after DNS change? If not, would you please provide me how to restart to make the change take effect without system reboot. If so, then would you please provide me how to use nslookup to check it's working or not AND how to fix if find incorrect one. BTW, /etc/resolv.conf is configured correct.

But, I'm sure there are bunch of HP-UX servers are not working properly, they are still lookup for the old DNS server, network team has show me the report.

Thanks.

-Gary
Steven Schweda
Honored Contributor

Re: After change IPs and hostname of DNS server

> [...] network team has show me the report.

And if my psychic powers were not so weak,
then _I _might be able to see that report,
too. As usual, showing actual evidence, that
is, actual commands with their actual output,
can be more helpful than vague descriptions
and interpretations, especially hearsay.
(Some people consider secret hearsay to be
especially unreliable.)

> [...] HP-UX servers [...]

Not a very detailed description of anything.

uname -a
TTr
Honored Contributor

Re: After change IPs and hostname of DNS server

As I said you need to find out specifically what is not working. On the OS level, running "nslookup some_hostname" will verify for you if the OS resolver is going to the new DNS server. After that you need to tell us exactly what does not work.

If your HP-UX server is only a ***DNS client***, there is nothing that you need to restart.

You may have read in other threads that you need to restart the pwgr daemon but that is only needed if you use NIS, it is not DNS related.

Gary L
Super Advisor

Re: After change IPs and hostname of DNS server

Thanks TTr, those HP-UX servers just DNS client, so far there is no user's ticket mention name resolution problem on those HP-UX boxes, just network team still bug us said they found bunch servers still communicating with old DNS servers.

-G
Jim Walls
Trusted Contributor

Re: After change IPs and hostname of DNS server

You could use tcpdump and lsof to find out which processes in the HP-UX servers are trying to use those old DNS servers.

Alternatively, you could ask the network team to turn off the old DNS servers (after all, everyone should be using the new ones, right?). Anything in your HP-UX boxes that rely upon those particular DNS servers will soon stop working!

Matti_Kurkela
Honored Contributor

Re: After change IPs and hostname of DNS server

Disclaimer: this is based on what I learned the hard way the last time we had to do a major DNS server change, which was years ago. I have not seen anything that would indicate the situation has changed. But if it has, I'd be very happy to hear about it.

In HP-UX (at least 11.11 and older), each process will read /etc/resolv.conf once when it's starting up and then never again. If you modified resolv.conf while applications are running, those applications will still be using the old settings until they are restarted.

This behaviour is coded into the system's standard libraries (/usr/lib/libc.*), which are used by practically all programs, so essentially all programs will behave the same.

(The function that actually reads resolv.conf is called res_init(); if you want, you can use truss or a similar tool to verify e.g. whether a daemon re-executes this function or not if you send it a HUP signal. If you're a programmer and have never heard of this function, it is probably because the libc initialization code calls it for you before entering the main() function of your program.)

So it's not a matter of restarting one process or just a few processes; you must restart *all* long-running processes that use network hostnames in any way. The easiest way to do this is to reboot the system.

Because nslookup is a process, it will read the current resolv.conf settings whenever you start it. It will tell you how any new processes will do DNS lookups, but not what the old processes are doing.

MK
MK
Gary L
Super Advisor

Re: After change IPs and hostname of DNS server

Hi MK

Thanks a lot for your detail explainations above.

Have a good weekend.

-Gary
Ismail Azad
Esteemed Contributor

Re: After change IPs and hostname of DNS server

Hi Gary,

Remember, starting and stopping services doesn't exactly always serve the purpose you want because certain services might be dependent on others and hence starting and stopping of those services would also be required. At the DNS server side there is the one critical daemon running called as named. So at the server side starting and stopping the daemon might help. Just adding to the initial part of what i said and adding to what the Pharoah said, the CLEANEST way to start any service is to give a reboot (not practical most of the times especially for a production server) as a reboot starts all the dependencies in a sequential fashion. Yes, on the client side I am not aware of a daemon or service that can be started or reread the /etc/resolv.conf file. Hope the info helps.

Regards
Ismail Azad
Read, read and read... Then read again until you read "between the lines".....
Gary L
Super Advisor

Re: After change IPs and hostname of DNS server

Thanks everyone.

-Gary