rfr1tz
asked on
How to use nslookup if the machine does not access to any DNS server?
Hi,
We've a DB server (Oracle) running on a Sun Solaris. This server has no access to any DNS server. The only thinng it has for host names lookup is the file /etc/hosts. Inside the file /etc/nsswitch.conf, there is the line "hosts: dns files" So, a service to lookup
My first question: Is it possible to make nslookup look into the file /etc/hosts for the host name lookup, instead of using a DNS server?
If it is not possible, can I think that the line "host: dns files" inside nsswitch.conf has no effect on nslookup?
If you know some way to make nslookup to use /etc/hosts for host name resolution, please give some help. Any help is appreciated.
Thanks,
Rfr1tz
We've a DB server (Oracle) running on a Sun Solaris. This server has no access to any DNS server. The only thinng it has for host names lookup is the file /etc/hosts. Inside the file /etc/nsswitch.conf, there is the line "hosts: dns files" So, a service to lookup
My first question: Is it possible to make nslookup look into the file /etc/hosts for the host name lookup, instead of using a DNS server?
If it is not possible, can I think that the line "host: dns files" inside nsswitch.conf has no effect on nslookup?
If you know some way to make nslookup to use /etc/hosts for host name resolution, please give some help. Any help is appreciated.
Thanks,
Rfr1tz
Oops, `nslookup` on Solaris only works for DNS, and so will always fail; But "normal" functions like gethostbyname will obey the rules in nsswitch.conf
Or set this system up as a DNS server so it will query itself?
https://www.experts-exchange.com/questions/20168736/How-to-configure-Sun-as-a-DNS-server.html
http://developers.sun.com/solaris/technotes/named.html
https://www.experts-exchange.com/questions/20168736/How-to-configure-Sun-as-a-DNS-server.html
http://developers.sun.com/solaris/technotes/named.html
With nslookup there is an option to nslookup on a specific name server and bypass the resolv.conf.
the syntax is:
nslookup <host> [ nameserver ]
Hope this helps
the syntax is:
nslookup <host> [ nameserver ]
Hope this helps
ASKER
Thanks for all the info.
We cannot set this up as a DNS server due to security concern. There is a suggestion that writing a script named "nslookup" that actually reads the lines of /etc/hosts and do the job exactly the same as nslookup (of course, we've to rename the real nslookup).
However, I've no idea about how to start wrting this script. If you have some ideas about how to create this kind of script, please help.
Thanks a lot,
Rfr1tz
We cannot set this up as a DNS server due to security concern. There is a suggestion that writing a script named "nslookup" that actually reads the lines of /etc/hosts and do the job exactly the same as nslookup (of course, we've to rename the real nslookup).
However, I've no idea about how to start wrting this script. If you have some ideas about how to create this kind of script, please help.
Thanks a lot,
Rfr1tz
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hosts: files