Solved

How to make nslookup works without dns server?

Posted on 2004-08-06
10
1,654 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…
Suggested Courses

732 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