- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- RHEL4U$ > nslookup not looking up /etc/hosts on pr...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 03:22 AM
тАО09-25-2008 03:22 AM
RHEL4U$ > nslookup not looking up /etc/hosts on private network
I've installed Red Hat Enterprise Linux AS release 4 (Nahant Update 4) on a server for testing purposes.
I have no DNS server and am defining the hostname and domainname my self..
ie:
domainname: my.test.com
hostname: box
IP is private: 192.168.0.101
There are two servers on this network.
they can ping each other and I can ssh from one to the other.
However, when installing an application (not mine) it's startup scripts run the host command.
this command does not work and times out on my server just as nslookup does:
[root@box ~]# nslookup box
;; connection timed out; no servers could be reached
my config is as attached...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 04:34 AM
тАО09-25-2008 04:34 AM
Re: RHEL4U$ > nslookup not looking up /etc/hosts on private network
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 04:58 AM
тАО09-25-2008 04:58 AM
Re: RHEL4U$ > nslookup not looking up /etc/hosts on private network
Unless you are hosting a DNS server on the system, this is the problem.
[root@diameter ~]# cat /etc/resolv.conf
domain my.test.com
search my.test.com
nameserver 127.0.0.1
You need a nameserver that contains DNS information for your network
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 05:23 AM
тАО09-25-2008 05:23 AM
Re: RHEL4U$ > nslookup not looking up /etc/hosts on private network
I removed resolv.conf
and removed everything but files for hosts from nsswitch.conf and rebooted.
nslookup, host commands still timeout:
[root@box /]# Last login: Thu Sep 25 11:33:09 2008 from 192.168.0.102
[ocadmin@box ~]$ nslookup box
;; connection timed out; no servers could be reached
[ocadmin@box ~]$ host box
;; connection timed out; no servers could be reached
[ocadmin@diameter ~]$ ping diameter
PING box (192.168.0.101) 56(84) bytes of data.
64 bytes from diameter (192.168.0.101): icmp_seq=0 ttl=64 time=2.00 ms
[ocadmin@box ~]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
192.168.0.101 box box.my.test.com
Thanks for the replies so far...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 06:21 AM
тАО09-25-2008 06:21 AM
Re: RHEL4U$ > nslookup not looking up /etc/hosts on private network
Configure a DNS server on one fo the linux boxes, you can do it quickly by modifying the files provided by caching-nameserver.
Or maybe, you can just trick the installation program, build your own "host" command with a script to return the desired value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 06:56 AM
тАО09-25-2008 06:56 AM
Re: RHEL4U$ > nslookup not looking up /etc/hosts on private network
[ocadmin@diameter lib]$ cat /usr/bin/host
echo "box.my.test.com has address 192.168.0.101"
etc...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 08:13 AM
тАО09-25-2008 08:13 AM
Re: RHEL4U$ > nslookup not looking up /etc/hosts on private network
nslookup 192.168.0.101
nslookup box.my.test.com
or
host 192.168.0.101
host box.my.test.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 08:16 AM
тАО09-25-2008 08:16 AM
Re: RHEL4U$ > nslookup not looking up /etc/hosts on private network
;; connection timed out; no servers could be reached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 11:11 AM
тАО09-25-2008 11:11 AM
Re: RHEL4U$ > nslookup not looking up /etc/hosts on private network
Contrary to HP-UX where nslookup tries to resolve from /etc/hosts and dns, the normal nslookup (as implemented in Linux and all the other systems (Unixes, windows, etc...)) stands to request only DNS nameservers.
If there is no resolv.conf on the system, nslookup will try to request 127.0.0.1 even if there is no bind running on the system.
To try to resolve host names (as well as many other services) you should try getent:
getent hosts box or getent hosts 192.168.0.101
It will rely on /etc/nsswitch.conf (man nsswitch.conf)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2008 11:42 AM
тАО09-25-2008 11:42 AM
Re: RHEL4U$ > nslookup not looking up /etc/hosts on private network
As Brem points out, host and nslookup are working as expected, or at least as I'd expect them to on Linux.
The man page for nslookup on Linux is quite different to that on HP-UX.
HP-UX: nslookup is a program to query Internet domain name servers. If a name server is not configured, nslookup uses NIS if it is configured. Otherwise the local host table, /etc/hosts, is used.
Linux: nslookup is a program to query Internet domain name servers.
It's doing what it says on the tin !
Cheers,
Rob