I am too young not to be able to resolve myself...nslookup problem (no DNS available)


 
Thread Tools Search this Thread
Operating Systems Solaris I am too young not to be able to resolve myself...nslookup problem (no DNS available)
# 1  
Old 11-15-2005
I am too young not to be able to resolve myself...nslookup problem (no DNS available)

I don't have DNS, and would like to resolve EVERYTHING through local /etc/hosts file.

My first sunbox has the following configuration:

# hostname
mybox.home.com


My host file is as follows:
# cat /etc/hosts
#
# Internet host table
#
127.0.0.1 localhost
192.25.x.x mybox.home.com mybox loghost


ifconfig is correct, and ping works:
# ping mybox.home.com
mybox.home.com is alive


I don't have a resolve file:
# ls /etc/res*
/etc/res*: No such file or directory


my nsswitch.conf looks like the following (no DNS):
# cat /etc/nsswitch.conf
#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

passwd: files
group: files
hosts: files
ipnodes: files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
printers: user files
auth_attr: files
prof_attr: files
project: files



yet I can't even resolve the box itself?


# nslookup mybox.home.com
;; connection timed out; no servers could be reached

# host 192.25.x.x
;; connection timed out; no servers could be reached

# nslookup 192.25.x.x
;; connection timed out; no servers could be reached

what am I missing?
manny
# 2  
Old 11-15-2005
I don't get it... You state you don't want or need DNS
Quote:
I don't have DNS, and would like to resolve EVERYTHING through local /etc/hosts file.
So why are you using nslookup? That is to lookup names from DNS (which means you need a /etc/resolv.conf pointing to a nameserver).
# 3  
Old 11-15-2005
I thought there was a way to configure the box to resolve hostnames and IPaddresses through /etc/hosts

Is this wrong?
# 4  
Old 11-15-2005
Like it was mentioned before, nslookup attempts to contact a (DNS) nameserver, which is exactly what you don't want to do. Simply putting the appropriate entries in /etc/hosts will accomplish what you would like.
Try typing

Code:
ping mybox.home.com

# 5  
Old 11-15-2005
I thought I could configure the box, so that nslookup and host commands would resolve through /etc/hosts only.
thanks for clearing this up...your guidance is appreciated.

I'll be a solaris admin yet Smilie
# 6  
Old 11-15-2005
No, the closest you can get tho that is:

getent hosts some_hostname
# 7  
Old 11-20-2005
This is one of the reasons why nslookup is deprecated in Linux. It uses its own libraries, not the same ones practically everything else on the box uses! That is, nslookup *will* use DNS- no matter what, even if you don't have it on the machine. It's hardcoded.

This is different behavior than the host resolution of, say, the ping command. That's why your nslookup will not work but your ping will. So you'll need to stick to ping for your testing.
-Mike
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Could not resolve ip through DNS

Dear all , Very recently our DNS server ip got changed. I have entered the DNS ip in /etc/resolv.conf ...but I could not resolv it for my ip address. Verified that , the IP is added in the DNS also. It is still working with the old DNS ip. Please let me know what could be... (11 Replies)
Discussion started by: jegaraman
11 Replies

2. HP-UX

nslookup/ping resolve problem 11i v3

I am having a problem with a new server build that has got me completely baffled. This server has a private back end network so the way it is supposed to work is that the server thinks its ip address is 10.131.0.48 but the rest of the world knows it as 199.68.100.100 per DNS. It has to be this way... (2 Replies)
Discussion started by: keelba
2 Replies

3. Red Hat

Mail Problem. Maybe, it is a DNS Problem!

Hi, i've a redhat linux 9 upadated by redhat from 7 version to 9 version. A couple of days ago i was a problem with my mail, in other words i'm not able to get any email nor to send any email. I've a proxy configuration and i tried to set iptables in order to verify the port. The 110,255 and 995... (1 Reply)
Discussion started by: pintalgi
1 Replies

4. Shell Programming and Scripting

Scripting nslookup to resolve multiple hostnames

Hi Friends, I have a list of servers with their production names in a file. I want to know the best way eiter a command or a script that can do the following :- Append "-bkp" to each hostnames at the end And run nslookup and make sure I have valid backup IP add assigned to it. Any... (1 Reply)
Discussion started by: new2prog
1 Replies

5. Linux

resolve one IP on DNS server

Hi! I have a dns server (bind) with 2 zones forward and reverse and i need to resolve one ip completely different. I have add to /etc/hosts and i can ping but i can't do nslookup. I've tried to add the dns server responsible to resolve that ip on /etc/resolv.conf without success. So how can i... (2 Replies)
Discussion started by: BufferExploder
2 Replies

6. Shell Programming and Scripting

please resolve the below problem

#!/bin/sh # 'clear' for i in $(seq -w 15 37) do echo $i echo The content in Z Z=`wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.com:8000/webcore/test/test.jsp` echo $Z A="Connection timed out." echo The content in A echo $A expr "$A" : '..\(...\)' echo $A done ... (1 Reply)
Discussion started by: veerumahanthi41
1 Replies

7. UNIX for Advanced & Expert Users

DNS client nslookup

Hello, I just got done setting up a DNS server and a client. However, when I do an nslookup with just the hostname, I got this output: Microsoft Windows 2000 (C) Copyright 1985-2000 Microsoft Corp. C:\Documents and Settings\dev9>nslookup dev9 Server: webdev.testsurgemail.com Address:... (3 Replies)
Discussion started by: xnightcrawl
3 Replies

8. UNIX for Advanced & Expert Users

nslookup problem

I am having trouble configuring BIND 8.3 on Solaris 9. When I run nslookup, I get this error/message: test# nslookup *** Can't find server name for address 192.168.1.31: Non-existent host/domain *** Default servers are not available I double checked everything and I can't figure this out. I... (8 Replies)
Discussion started by: xnightcrawl
8 Replies

9. Solaris

DNS Problem

hello !!! I have some problem for Sun Solaris DNS i already configured named.boot , named.rev, named.hosts but when i start the DNS service there is an error " error cannot find named.conf " in my manual there is no named.conf configuration it said that if you configure named.boot... (3 Replies)
Discussion started by: giancarlodjabon
3 Replies
Login or Register to Ask a Question