Solved

How to make nslookup works without dns server?

Posted on 2004-08-06
10
1,489 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
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…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

707 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

17 Experts available now in Live!

Get 1:1 Help Now