How to reload /etc/hosts file in AIX without reboot? I am trying to ping a new entry but it still shows previous version. Thanks
Asked
Active
Viewed 2.2k times
0
-
1You should probably update this with more information. Have you used nslookup or dig to test the dns lookup. What, exactly, are you pinging? Detail would help solve this. – Mark Jul 18 '11 at 18:15
-
Need more detail. Including some output. Are you running the ping from a session *on* the AIX machine, or are you running the ping from a client which is using the AIX machine for host lookups? – EightBitTony Jul 18 '11 at 19:40
3 Answers
4
Flush the netcd DNS cache:
netcdctrl -t dns -e hosts -f
Hostname lookup order is determined using /etc/irs.conf, /etc/netsvc.conf and then $NSORDER.
Keep in mind though, that irs.conf and $NSORDER are typically not used.

djangofan
- 4,182
- 10
- 46
- 59
-
1ipconfig doesn't work on AIX and you can't put order hosts,bind into an AIX resolv.conf. I assume you that you assume the original question was about a client of an AIX machine. – EightBitTony Jul 18 '11 at 19:40
-
@EightBitTony - thanks for calling me out on that. i did some research and changed my answer. thanks, i upvoted your comment. – djangofan Jul 19 '11 at 20:09
3
The hosts file change should be immediate. But AIX can be configured to look at DNS first and the hosts file second. Check the /etc/netsvc.conf
file to see if "local" is listed first.
If you are running named on the server you may need to restart it for DNS lookups... but the hosts file isn't normally cached anywhere.

Mark
- 2,248
- 12
- 15
1
I had the same problem and my new entry was the last line in the /etc/hosts file. I added a new blank line to the end of the file and magically it worked! :)

fallz
- 11
- 1