Solved

How to make nslookup works without dns server?

Posted on 2004-08-06
10
1,523 Views
Last Modified: 2013-12-15
Hi,

We've a DB server. This server doesn't have any access to DNS server. The only thing it has that can be used with nslookup is /etc/hosts. However, we don't know how to set up nslookup so that it will work without DNS server.

If you know how to set up this, please help. Any help will be appreciated.

Thanks,

Rfr1tz
0
Comment
Question by:rfr1tz
  • 2
  • 2
  • 2
  • +4
10 Comments
 
LVL 3

Author Comment

by:rfr1tz
ID: 11737024
Hi,

Can nslookup uses the file "/etc/hosts" to determine host names?
If the file /etc/nsswitch.conf has the line: hosts: dns files, can nslookup uses the file /etc/hosts to determine the host name.

Is it possible to make nslookup uses the file /etc/hosts if they found that there is no dns server access?

Thanks a lot for any help,

Rfr1tz
0
 
LVL 36

Assisted Solution

by:grblades
grblades earned 40 total points
ID: 11737457
Hi rfr1tz,
No nslookup only does lookups against a nameserver.
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 40 total points
ID: 11739663
2nd grblades
but most applications use the system's resolver library which can be tweaked to use /etc/hosts in /etc/nsswitch.conf (see hosts: entry)
0
 
LVL 44

Assisted Solution

by:Karl Heinz Kremer
Karl Heinz Kremer earned 40 total points
ID: 11740067
You probably don't want to access /etc/hosts from nslookup, what you want to do is use /etc/hosts to resolve the names your DB server has to use. This is connected to, but considerably different from nslookup. nslookup is the Name Services lookup (or Name Server lookup) tool, and does always connect to a DNS server. If I remember correctly, in the "old days" it actually came with and only with the bind distribution (this is one of the more important DNS servers).

Most systems actually come already configured to use /etc/hosts for name lookup without having to mess with /etc/nsswitch.conf. Try this: Add a host entry to /etc/hsots and then try to access this host with a ping command (e.g. ping host2). Do you get a response from the other host? If you do, your system is already setup correctly.

0
 
LVL 12

Accepted Solution

by:
mburdick earned 60 total points
ID: 11769065
To combine previous answers into one:

nslookup is a tool designed to query name servers for information. That's it's main purpose. It is not used by the OS to translate names to addresses.

It sounds like you want to be sure that your DB server, which has no access to DNS, can translate host names to addresses. You can accomplish this with two steps:

First, tell the OS to use the /etc/hosts file for resolution as its primary source of information. Modify your /etc/nsswitch.conf file so that the "hosts" line lists files before dns (or files only).

Second, place appropriate entries in the /etc/hosts files for the systems you need to resolve.

10.0.15.4     host1     host1.mydomain.com

Once all pieces are in place, try to ping a host by short name (host1) and long name (host1.mydomain.com) to be sure the resolve happens immediately and correctly. If something doesn't seem to be working properly, restart the system once and test again.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Assisted Solution

by:marcoakr
marcoakr earned 35 total points
ID: 11791379
You can use the program 'named-checkconf' to check the syntax (but not the semantics) of the named (BIND) configuration file :

[user@localhost]# named-checkconf  /etc/named.conf

on a freeBSD system.

Read a VERY good step by step tutorial at :

http://www.marcorodrigues.com/tutorials/DNS-Sendmail.pdf

for further explanations...

Good luck!
0
 
LVL 1

Assisted Solution

by:hazmatt81
hazmatt81 earned 35 total points
ID: 11833879
Yes, as others have said nslookup is used to look at a DNSserver, however if you put your entries into your /etc/hosts file such as:
192.168.0.1   database1.mydomain.com

the database server will find it just fine.
0
 
LVL 3

Author Comment

by:rfr1tz
ID: 11854991
Hi all,

Thanks so much for all your help.
Actually, the scenario is like this: We've an Oracle DB server. In their support, Orache insists that we must have nslookup enabled and working on the server. At the same time, due to requirments from senior system architects, we must not start DNS service on the server due to the security concern.

And it seems that we cannot compromise these 2 requirements: nslookup enabled & DNS service must be OFF.

If you've any idea about this scenarion, please give some help,

Thanks again,

Rfr1tz



0
 
LVL 36

Expert Comment

by:grblades
ID: 11855109
Can you edit the /etc/resolv.conf file and point it to another DNS server somewhere?
0
 
LVL 12

Expert Comment

by:mburdick
ID: 11867077
nslookup does NOT require that the DNS service be running locally on the machine. It only requires the ability to *communicate with* and DNS server, and that can be another machine.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now