LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 12-07-2010, 10:33 AM   #1
hansaplazt
LQ Newbie
 
Registered: Oct 2010
Posts: 21

Rep: Reputation: 0
Secondary nameserver resolv.conf not queried


I'm trying to query the second nameserver on a local network to resolve local domain names to IP's.
Code:
$ ping ids.mydomain.loc
ping: unknown host mydomain.loc
However, querying the name server directly works:
Code:
$ nslookup hostname 10.0.0.53
Server:         10.0.0.53
Address:        10.0.0.53#53

Name:   hostname.mydomain.loc
Address: 10.0.0.116
Here's /etc/resolv.conf
Code:
nameserver 123.123.123.123
nameserver 10.0.0.53
search ispdomain.com mydomain.loc
Analysing with 'dig' shows that only the first nameserver is queried. Why is this and how can I resolve it?
I'm using CentOS release 5.4.

Thanks
 
Old 12-07-2010, 11:26 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,925

Rep: Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327
This is how the resolver works. It asks the 1st nameserver in /etc/resolv.conf and if it's not responding it asks the 2nd one.
In your case the 1st (I guess it's a public dns) knows nothing about your domain, so it answers with "host unknown" and the 2nd is never queried.
You can exchange the order (or remove the 1st one) to make it work

Regards
 
1 members found this post helpful.
Old 12-07-2010, 05:55 PM   #3
hansaplazt
LQ Newbie
 
Registered: Oct 2010
Posts: 21

Original Poster
Rep: Reputation: 0
Makes sense. Thanks.

Btw. Is there a (config) option to query the secondary dns when the first answers with "host unknown"?
The 10.0.0.53 ns is on a vpn and I don't want all name lookups broadcasting on the vpn. That link is slower than the isp's.

Last edited by hansaplazt; 12-07-2010 at 06:09 PM.
 
Old 12-08-2010, 12:25 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,925

Rep: Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327
Hi,

I'm afraid there is no such option.
You can use the hosts file in every host of your network to bypass queries for your domain, but for a large network it's a pain to keep it updated.

Regards
 
Old 12-08-2010, 03:41 AM   #5
hansaplazt
LQ Newbie
 
Registered: Oct 2010
Posts: 21

Original Poster
Rep: Reputation: 0
Hmmm
Twould be convenient to have such an option.

How about a local DNS slave? Is it possible that a slave defines its own forward servers?
 
Old 12-08-2010, 04:09 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,925

Rep: Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327
It can be done.
You can setup a name server as a slave for one or more domains and forwarding for the rest.
But as I've already told you, you can put 10.0.0.53 first in /etc/resolv.conf. This way it can resolve your domain and query upstream name servers for the rest
 
Old 12-08-2010, 04:41 AM   #7
hansaplazt
LQ Newbie
 
Registered: Oct 2010
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
But as I've already told you, you can put 10.0.0.53 first in /etc/resolv.conf. This way it can resolve your domain and query upstream name servers for the rest
The problem with this set-up is that 10.0.0.53 queries the upstream name servers.
As I've told, 10.0.0.53 resides on a slow network link. Therefore (upstream name server) lookups are slow. I'd rather query upstream name servers via the ISP link which is much faster.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
nameserver entries in /etc/resolv.conf Ron7 Linux - Software 11 09-03-2010 03:18 PM
resolv.conf nameserver ordering/priorities jmoschetti45 Linux - Networking 6 01-25-2010 11:27 AM
resolv.conf deletes nameserver entries Mirkridian Linux - Wireless Networking 1 02-19-2007 01:59 AM
router being added to resolv.conf as nameserver thatwouldbeme Linux - Networking 3 11-15-2006 12:44 PM
pppd: nameserver -> /etc/resolv.conf ?? tredegar Linux - Networking 6 03-21-2004 07:45 AM


All times are GMT -5. The time now is 08:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration