- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- DNS resolver and etc/hosts file
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
06-17-2002 12:12 PM
06-17-2002 12:12 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2002 12:16 PM
06-17-2002 12:16 PM
Re: DNS resolver and etc/hosts file
hosts: dns [NOTFOUND=continue UNAVAIL=continue TRYAGAIN=continue] files
GL,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2002 12:19 PM
06-17-2002 12:19 PM
Re: DNS resolver and etc/hosts file
Make sure that in you /etc/nsswitch.conf file the hosts line is as follows
hosts: dns [NOTFOUND=continue] files
Or you can switch the order of dns/files if you want - the first will be searched first.
The key is to have BOTH in there & to tell it to continue if it's not in the first searched.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2002 12:22 PM
06-17-2002 12:22 PM
SolutionA little expansion on both replies
A little expansion on Patrick's reply
The entry in nsswitch is related to as the 'fall back mechanism'
When you send a query to the lookup resource always yields one of 4 results
SUCCESS - source found requested entry
UNAVAIL - Source is not configured
NOTFOUND - source responded "no such entry"
TRYAGAIN - server not responding
When the resolver receives one of these responses you can configure it to react in 2 ways
continue - Try the next source in the list
return - quit searching
Lets say we have the following in /etc/nsswitch
hosts: dns files
The above says that the resolver should try DNS first - SUCCESS = return else use the /etc/hosts files
As per Patrick's example - he is more explicitly defining the fallback mechanism
hosts : files [NOTFOUND=continue] dns
With the above entry , if the host is not found using /etc/hosts then the resolver will consult dns
If these actions are not specified the resolver uses the following defaults
SUCCESS=return
NOTFOUND=return
UNAVAIL=continue
TRYAGIN=continue
Therefore the UNAVAIL and TRYAGAIN lines ensure that the other specified resource is used
Hope this helps
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2002 12:32 PM
06-17-2002 12:32 PM
Re: DNS resolver and etc/hosts file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2002 12:35 PM
06-17-2002 12:35 PM
Re: DNS resolver and etc/hosts file
The resolver works in the order specified in the /etc/nsswitch.conf file. To check your /etc/hosts file first and then DNS, have this entry in /etc/nsswitch.conf file,
hosts : files [NOTFOUND=continue] dns
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2002 12:36 PM
06-17-2002 12:36 PM
Re: DNS resolver and etc/hosts file
Also you need to specify the DNS server in /etc/resolv.conf . The best way is to do a nslookup hostname and see how tghe same is resolved .
/etc/hosts should be like a backup for the DNS entreies ie in case the DNS server breaks down then the system look as at the /etc/hosts for resolving the name and addresses instead of looking for the DNS server only.
Manoj Srivastava