overriding /etc/resolv.conf with .nslookuprc file


 
Thread Tools Search this Thread
Special Forums IP Networking overriding /etc/resolv.conf with .nslookuprc file
# 1  
Old 12-30-2006
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)?

/smanu.
# 2  
Old 12-30-2006
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.
# 3  
Old 12-31-2006
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.

/smanu
# 4  
Old 12-31-2006
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:
set root=a.root.servers.net.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Configure resolv.conf and nsswitch.conf

Hi, I've installed Solaris 11.3(live media) and configured DNS. Everytime I reboot the server, resolv.conf got deleted and it created a new nsswitch.conf. I used below to configure both settings: # svccfg -s dns/client svc:/network/dns/client> setprop config/nameserver = (xx.xx.xx.aa... (1 Reply)
Discussion started by: flexihopper18
1 Replies

2. UNIX for Dummies Questions & Answers

DNS server - /etc/resolv.conf file issue

Hi, Am trying to configure DNS server and trying to keep the information in /etc/resolv.conf file as: search server nameserver 192.168.0.10 when i restart the network service with #service network restart, resolv.conf file is changing as: nameserver 192.168.0.10 search server -... (5 Replies)
Discussion started by: raosr020
5 Replies

3. Ubuntu

Adding Domain name n resolv.conf file without vi editor

Hi Guys, I want to add the domain name entry to resolv.conf file. when i use the vi editor to do it the changes are gone after DNS client is being restarted. In Solairs 11 I figured out svccfg command will help to retain the cinfguration. but in linux how do we do that. Also for Solaris are there... (2 Replies)
Discussion started by: karthikk0508
2 Replies

4. Red Hat

Issue on resolv.conf

Hi all, :( I am facing issue while I have updated in resolv.conf, after nework service restart, it was automatically deleted IP from resolv.conf file. Could you please let me know what is the reason resolv.conf deleted any IP which I have manually updated, but it store only my router IP... (3 Replies)
Discussion started by: Pradipta Kumar
3 Replies

5. Shell Programming and Scripting

Loop through hosts file - cat /etc/resolv.conf

Hello... I am trying to loop through my hosts file that contains 100+ servers to check or update the nameservers on them... My while loop is breaking after the first server responds... #!/bin/bash while read line; do a=( $(echo $line | tr " " "\n") ) if }" != "" ] && }" != "#" ] &&... (1 Reply)
Discussion started by: CompSCI
1 Replies

6. Ubuntu

resolv.conf

Hi, My resolv.conf keeps overwritten. I want to have it to just keep the setting that I put in there. I tried a few solutions I found using google. like supersede domain-name "xxx", prepend domain-name-servers xxx.xxx.xxx.xxx; This does'nt work. I also tried to just chmod the file to... (4 Replies)
Discussion started by: jld
4 Replies

7. UNIX for Dummies Questions & Answers

resolv.conf

Hi everyone A quick question during a audit this was determined to be a security issue In the resolv.conf there is a “.” At the end of the domain name Like this domain mydomain.com. I which to understand the function or significance of the . thk (3 Replies)
Discussion started by: Ex-Capsa
3 Replies

8. Shell Programming and Scripting

resolv.conf

HI ALL I am making a script,That will does the following,I am in search of ideas 1.Script will comment all existing the entries in resolve.conf 2.Add new entries like this abc.example.com 192.168.1.x I can use sed to add comment. (8 Replies)
Discussion started by: aliahsan81
8 Replies

9. SuSE

Suse 10 resolv.conf

I want to have 7 search domains in my resolv.conf, but it seems to like only the first six. I read somewhere that the OS will only recognize the first 6 (or the first 154 characters). Is that the case with SUSE 10? thx -Kevin (2 Replies)
Discussion started by: kjbaumann
2 Replies

10. IP Networking

/etc/resolv.conf

I am new to unix. I have edited the /etc/resolv.conf. It shows domain name ip address ip address These are the same ips of the dns I use for windows. Still I get no name resolution on the internet. I can ping external ip's is there anything else I need to check? (1 Reply)
Discussion started by: rpnhavoc
1 Replies
Login or Register to Ask a Question