The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: overriding /etc/resolv.conf with .nslookuprc file
honey
Newbie
Rank: 1



UID 175
Digest Posts 0
Credits 0
Posts 10
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at May 27, 2007 12:21 PM  Profile | P.M. 
overriding /etc/resolv.conf with .nslookuprc file



overriding /etc/resolv.conf with .nslookuprc file



hi,

i have come across a fact that /etc/resolv.conf can be overrided by using ~/.nslookuprc.
is this completely true...i.e can i completely override /etc/resolv.conf.


if so, can i have a list of my own domainnames & nameservers in ~/.nslookuprc that can override those in resolv.conf.

could anybody give me a sample .nslookuprc(a bit evolved one that can expose all it's features)?


Top
jabz.biz
Newbie
Rank: 1



UID 193
Digest Posts 0
Credits 0
Posts 26
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at May 27, 2007 12:21 PM  Profile | P.M. 
quote:
originally posted by smanu
i have come across a fact that /etc/resolv.conf can be overrided by using ~/.nslookuprc.
is this completely true...i.e can i completely override /etc/resolv.conf.




no, it is almost totally false.

when you give a command like "telnet this.that.com", the telnet command must convert this.that.com to an ip address. to do that, the telnet program will call some subroutines that are called the resolver. the resolver will read /etc/resolv.conf (assuming that the box is configured to use dns). but the resolver does not know about .nslookuprc and will ignore it completely.

meanwhile, there is a program called nslookup which is sometimes used to debug dns issues. nslookup is the first widespread dns tool. it (unfairly i think) has a reputation as a poor tool. many people have moved on to "dig" which is a more powerful dns tool. but some folks still use nslookup. nslookup does not use the resolver. but it sometimes peeks at /etc/resolv.conf directly. nslookup is the only program that knows about .nslookuprc. if you put enough stuff in .nslookuprc, nslookup will not need to peek at /etc/resolv.conf. in this sense alone can .nslookuprc override /etc/resolv.conf.
Top
cfajohnson
Newbie
Rank: 1



UID 19
Digest Posts 0
Credits 0
Posts 63
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at May 27, 2007 12:21 PM  Profile | P.M. 
hi perderabo,

thanks for the reply. i asked the question exactly in the context of using nslookup, not in the general resolver sense.

the answer i'm looking out for is: how can i override the domain name & name servers listed in /etc/resolv.conf with nslookuprc. i assue we can somehow override them but do not exactly know how? it would be great if you can provide me a sample .nslookuprc!

also how do we specify timeouts(for individual name servers) in /etc/resolv.conf? i'm looking out for the exact format.
Top
bizoppz
Newbie
Rank: 1



UID 70
Digest Posts 0
Credits 0
Posts 54
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at May 27, 2007 12:21 PM  Profile | P.M. 
the nslookuprc file can contain any legal set directives that could be used in interactive mode.

try this in interactive mode to see what options you have:

code:

set all

sample .nslookuprc to use a diferent root server

code:
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:31 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.005183 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP