Operating System - HP-UX
1819843 Members
2556 Online
109607 Solutions
New Discussion юеВ

DNS lookup's going to old nameserver after changing /etc/resolv.conf

 
David Manson
Occasional Advisor

DNS lookup's going to old nameserver after changing /etc/resolv.conf

Hi all,
We have recently replaced a couple of old DNS nameservers in our network, but after having updated the /etc/resolv.conf file on this particular server, with the details of the new DNS nameservers, we still find that DNS queries are being sent to the old nameservers.
My problem is that I am unsure of the effect on this server when the old nameservers are switched off.
In an attempt to resolve this I have tried a SIGHUP of inetd, but still have the same problem.
I would prefer to avoid a complete server restart if possible, so would be interested in any suggestions on how to resolve this problem.

Thanks.

Regards,
Dave
10 REPLIES 10
Joseph Loo
Honored Contributor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

hi,

since u have restarted inetd but the same problem persists.

have u confirm that amendment made to /etc/resolv.conf is correct or would u like to post it here?

regards.
what you do not see does not mean you should not believe
Yogeeraj_1
Honored Contributor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

hi,

on windows clients, you can try to run: ipconfig /flushdns

on the hp-ux server, i don't know if something similar exists!

can you try to run nslookup and see what is really happening?

regards
yogeeraj

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Thayanidhi
Honored Contributor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

Hi,
Post the content of /etc/resolv.conf and /etc/nsswitch.conf
If names are used /etc/hosts needed.
How did you conclude the server is still looking at the old DNS server?

Regds
TT
Attitude (not aptitude) determines altitude.
Bill Hassell
Honored Contributor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

When testing DNS servers, use the explicit server option in nslookup, something like this:

nslookup www.hp.com 12.34.56.78

where 12.34.56.78 is the specific nameserver to query. Then use nslookup without the 12.34.56.78 server and it should report the same results. However, the actual behavior of resolving hostnames depends on /etc/nsswitch.conf and often needs to be changed.


Bill Hassell, sysadmin
Matti_Kurkela
Honored Contributor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

Most programs that use DNS will do so using a name resolver functions in a library provided by the OS.

When the application starts, it will load and initialize the library with the resolver functions if it needs DNS. Reading /etc/nsswitch.conf and /etc/resolv.conf is one part of the initialization code of that library.

This means most programs will read /etc/resolv.conf only at the point when they're starting up. To activate the new settings, you must stop and restart the application.
MK
David Manson
Occasional Advisor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

Thanks for all the replies.

In answer to your questions ...

The amendment made to /etc/resolv.conf is correct (same used across many other servers).

nslookup is resolving correctly ... it appears to be a running process that is still querying the old nameserver.

Our network team records all IP's querying this 'old' nameserver, which is how I can identify this particular server.

I will try Matti's suggestion and stop and restart the applications on this server.

Thanks again.
Mike Duffy_1
Honored Contributor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

Dave,

did you check that none of the apps was caching DNS entries? Also could it be that your box is running as a name caching server.

Rita C Workman
Honored Contributor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

hmmm....

..well fixing your /etc/resolv.conf is something you should have done.

I'm no DNS expert...but on ours we have to fix the master DNS configuration file when we remove or change DNS servers - and then we have to run the command to rebuild DNS from the hostfile (with the new host info now added) ??

Just a thought,
Rita
Tim Nelson
Honored Contributor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

Dave,

Just a dumb question. Is this host a named server ? or client ?

All changes I have ever made to a client in the resolv.conf file are immediate (hence the name Dynamic Named Service).

nslookup
> server localhost
> set swtrace
> set debug
> host_to_look_up

The output from the above may help troubleshoot.
David Manson
Occasional Advisor

Re: DNS lookup's going to old nameserver after changing /etc/resolv.conf

Thankyou all for your replies and suggestions.

I have resolved this problem by restarting the server. It is now issuing queries to the new nameservers.

regards,
Dave