Unable to pick up HOSTS file

Posted:
in macOS edited January 2014
I am working on Mac OS X version 10.4.9



We use HOST Icons (shell scripts) to change environments. I have verified that /etc/hosts is being overwritten successfully every time the environment is changed.



Apparently version 10 made changes and settings must be made to configure /etc/hosts (see the following http://www.netneurotic.net/mac/configuring.html scroll to the "Configuring /etc/hosts" section).



Per that article I successfully completed the following steps:

1) Create (as root or using sudo) "/etc/hosts".

2) Read the file into NetInfo: "niload hosts . < /etc/hosts"

3) Create a directory "/etc/lookupd".

4) Create a file "hosts" in that directory.

5) Make it contain this line: "LookupOrder FFAgent NIAgent DNSAgent"

6) Reboot the machine or.



This is supposed to tell the OS to read the hosts flat file /etc/hosts (FFAgent) instead of NetInfo (NIAgent).



We verified that /etc/hosts is still not being read after the configuration changes.



Here's another link that talks about BSD flat files and necessary config settings but doesn't say where to make the changes: http://www.macosxhints.com/article.p...03111408024291



Is anyone aware of other Settings I can try to get the /etc/hosts file to be read?

Comments

  • Reply 1 of 1
    mcroninmcronin Posts: 6member
    Quote:
    Originally Posted by mcronin View Post


    Per that article I successfully completed the following steps:

    1) Create (as root or using sudo) "/etc/hosts".

    2) Read the file into NetInfo: "niload hosts . < /etc/hosts"

    3) Create a directory "/etc/lookupd".

    4) Create a file "hosts" in that directory.

    5) Make it contain this line: "LookupOrder FFAgent NIAgent DNSAgent"

    6) Reboot the machine.



    I am replying to my own posting in case someone with a similar hosts issue can find this helpful - I got the hosts to work with a change in Step 5 above.



    Instead of this:

    LookupOrder FFAgent NIAgent DNSAgent



    I used this and /etc/hosts works now:

    LookupOrder Cache FF DNS NI DS
Sign In or Register to comment.