- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- nsswitch question
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
Forums
Discussions
Discussions
Discussions
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
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
07-13-2006 06:03 AM
07-13-2006 06:03 AM
I have a Redhat webserver (HP DL360). When
doing "nslookup hostA" it said not found even
hostA is in /etc/hosts. The nsswitch.conf
defines to search files first:
hosts: files [NOTFOUND=continue] dns
The /etc/resovle.conf looks like this:
domain xyz.com
search xyz.com
nameserver 192.168.xx.yy
Why nslookup did not go to files first? what's wrong with nsswitch.conf file?
Lynn
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 08:12 AM
07-13-2006 08:12 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 09:37 AM
07-13-2006 09:37 AM
Re: nsswitch question
Run "gethostip" from the command line.
$> gethostip hostA
will return something like
hostA 192.168.xxx.xxx [8 digit hex number]
so, you'd want something like
$> gethostip hostA | cut -f 2 -d" "
192.168.xxx.xxx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 09:43 AM
07-13-2006 09:43 AM
Re: nsswitch question
Sorry if it does, it is taking about FIVE minutes to post right now, and I saw a change I wanted to make, and instead of a follow up - I'm trying to get it all in one post, in case it hasn't gone through yet.
--------Excuse if it is a double post--------
The command to resolve a name to an ip address - regardless of whether or not it is resolved in a dns server, or a host file, nis etc. is already in linux.
Run "gethostip" from the command line.
$> gethostip hostA
will return something like
hostA 192.168.xxx.xxx [8 digit hex number]
$> gethostip -d hostA
will return just the ip address
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 09:46 AM
07-13-2006 09:46 AM
Re: nsswitch question
it is for the name resolution search order.
Lynn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2006 11:35 PM
07-13-2006 11:35 PM
Re: nsswitch question
nsswitch.conf is critical. It decides how a system will resolve hostnames, how it will authenticate users, any number of things.
It is problably the most important configuration file after the network configuration.
As posted your nsswitch.conf file, which must be in the /etc directory should look in files first and then if not found continue to DNS.
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
07-14-2006 10:44 AM
07-14-2006 10:44 AM
Re: nsswitch question
applications like 'ping' use the standard system calls to do their resolution work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2006 10:52 AM
07-14-2006 10:52 AM
Re: nsswitch question
It is for name resolution search order (among other things).
U got it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2006 06:33 AM
07-19-2006 06:33 AM
Re: nsswitch question
Lynn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2006 06:35 AM
07-19-2006 06:35 AM