1837112 Members
2401 Online
110112 Solutions
New Discussion

Secondry DNS

 
akthar abdul jabbar
New Member

Secondry DNS

Hi ..

How to configure secondry DNS in my server. Pls Help.
12 REPLIES 12
Hoefnix
Honored Contributor

Re: Secondry DNS

edit the /etc/resolv.conf file like next:

search blbla.bla.com
nameserver
nameserver


Regards,

Peter
G. Vrijhoeven
Honored Contributor

Re: Secondry DNS

HI,

Peter is right, but you can also use the domain string in /etc/resolv.conf.
Check man resolv.conf

Gideon
Elmar P. Kolkman
Honored Contributor

Re: Secondry DNS

Do you mean to use a secondary DNS? Then Peter's solution is right.
If you mean: how do I configure my server to be a secondary DNS, it is more tricky.
You need to copy your named.conf file from the primary DNS, replace all 'master' entries to 'slave' entries, create the directory used for storing the database files, edit /etc/rc.config.d/namesvrs to start the named, etc.

Before going into more detail on this, explain what you want.
Every problem has at least one solution. Only some solutions are harder to find.
akthar abdul jabbar
New Member

Re: Secondry DNS

Hi Thanks for quick response,

Do I Need to reboot the server after editing the resolv.conf or it takes effect automatically once I save the file

Akthar
G. Vrijhoeven
Honored Contributor

Re: Secondry DNS

Hi,

No reboot, it should work right away.

Gideon
akthar abdul jabbar
New Member

Re: Secondry DNS

Hi Elmar,

I want to use secondry DNS address , And I used Peter's suggestion and edited the resolv.conf file .. I have reboot the server or I have to start stop any deamon to take this to effect ??!!

Thanks again for all for useful inputs

Regards

Akthar
Hoefnix
Honored Contributor

Re: Secondry DNS

If you want to test the changes, just swap 1st and 2nd nameserver in the resolv.conf (change the order in the file)and do an nslookup .

From the response you can figure out which DNS-server is used.

Regards,

Peter
Elmar P. Kolkman
Honored Contributor

Re: Secondry DNS

Goodmorning Akhtar (though probably afternoon for you),

If you only want to use a secondary nameserver from the machine, you don't have to reboot. Every time a lookup is done on the server, /etc/resolv.conf is read for the order of DNS servers. Like Peter said you can test it directly.
Every problem has at least one solution. Only some solutions are harder to find.
Jakes Louw
Trusted Contributor

Re: Secondry DNS

Just check that you have set /etc/nsswitch.conf to include DNS as an option.
Trying is the first step to failure - Homer Simpson
D.Blond
Frequent Advisor

Re: Secondry DNS

If you want to test the changes, just swap to 2nd nameserver in "nslookup" with the command "server".
Dominique
D.Blond
Jakes Louw
Trusted Contributor

Re: Secondry DNS

Or you could request the nslookup from a specific DNS server:

nslookup ipaddress dnsserver

eg: nslookup 165.143.128.21 dns2
Trying is the first step to failure - Homer Simpson
Sridhar Bhaskarla
Honored Contributor

Re: Secondry DNS

Hi,

Add another line that says "nameserver ip_address" to your /etc/resolv.conf.

DNS will be searched using the servers specified in the order in /etc/resolv.conf. There are couple of points to be noted.

1. As long as the first server responds, secondary name server will not be used.
2. If the first server does not respond, then the queries will go to next server in the order after the default "retrans" value. The retrans value is 5 seconds.
3. You can add the configurable parameters retrans and retry to /etc/resolv.conf to set the timeout. retrans is specified in milli seconds. For ex.,

domain yourdomain.com
nameserver 10.10.10.10
nameserver 10.10.10.20
retrans 2000
retry 2

The above will set the timeout to 2 seconds before the system call queries the next timeout.

4. There is no daemon like 'nscd' in hp-ux that will take care of automatically failing over to the next name server in the resolv.conf file in case the primary server does not respond. So each query has to go through the retrans timeout.

5. nslookup is not a 100% method to test the configuration in /etc/resolv.conf as it doesn't use gethostbyent() calls. But retrans is in effect for all the services that use gethostbyent() set of calls.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try