Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
You 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

2 Answers 2

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.

share|improve this answer
1  
ipconfig 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

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.

share|improve this answer
    
local is listed first. However still it does respect my new entries –  Gok Demir Jul 18 '11 at 17:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.