- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: /etc/hosts get ignored on redhat 6
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
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
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-31-2012 11:40 AM - edited 07-31-2012 02:24 PM
07-31-2012 11:40 AM - edited 07-31-2012 02:24 PM
/etc/hosts get ignored on redhat 6
I tried the following in /etc/nsswitch.conf:
hosts: files [NOTFOUND=continue] dns
or
hosts: files dns
Also, in /etc/host.conf
order files,bind
Whatever I do, /etc/hosts still could not get checked, as if get ignored. Would you please let me know why?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2012 05:15 PM
08-26-2012 05:15 PM
Re: /etc/hosts get ignored on redhat 6
How are you checking?
If you use either of nslookup or hosts then you will get unexpected results. These commands ignore /etc/hosts and go directly to the DNS for name resolution. The only way I know of checking the order in which names are resolved is to invoke something like ping, telnet or ssh, and see what address the hostname resolves to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2012 01:32 AM
08-27-2012 01:32 AM
Re: /etc/hosts get ignored on redhat 6
In Linux, the "getent" command can be used to test hostname resolution using the order specified in /etc/nsswitch.conf.
For example:
# getent hosts localhost
# getent hosts localhost4 # getent hosts 127.0.0.1
The "getent" command can be used to test other name resolution services too: for example, "getent passwd username" would find the user's /etc/passwd information from any configured source (i.e. /etc/passwd, NIS and/or LDAP).
Also, make sure you haven't accidentally changed the permissions of the /etc directory or of the configuration files /etc/nsswitch.conf, /etc/resolv.conf and /etc/hosts: these need to be readable by all users, but writeable by root only.