I was trying to set up my new Mac to be like my Windows PC for testing, so I need to have a few custom host names resolve to local IP addresses. All I could find in Google kept telling me to use /etc/hosts, or NetInfo Manager. I tried both of these methods and neither worked. I am using the latest version of OS X, 10.4.10.

I finally found my savior: this wonderful article on Mac OS X Hints. It’s extremely frustrating and annoying that so many sites skip the step of changing your default LookupOrder. If you don’t, your hosts file will be completely ignored for cached and existing hostnames.

picture-1.png

There is one mistake in the article, though. To find the running process of lookupd, use:

top -l1|grep lookupd

The article omits the 1, which might have come in a later version of top.

elliot-lees-computer:/etc/lookupd elliot$ top -L|grep lookupd
elliot-lees-computer:/etc/lookupd elliot$ top -l1
Processes:  77 total, 2 running, 75 sleeping… 246 threads            14:08:37
Load Avg:  0.15, 0.12, 0.09     CPU usage:  6.7% user, 53.3% sys, 40.0% idle
SharedLibs: num =  206, resident = 50.0M code, 6.27M data, 21.5M LinkEdit
MemRegions: num =  9007, resident =  242M + 19.0M private,  176M shared
PhysMem:   180M wired,  267M active,  381M inactive,  829M used,  194M free
VM: 12.8G +  143M   229167(0) pageins, 203225(0) pageouts

PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
766 top          0.0%  0:00.07   1    17    19   260K   452K   780K  26.9M
747 bash         0.0%  0:00.02   1    14    16   200K   868K   804K  27.1M
746 login        0.0%  0:00.00   1    16    40   172K   544K   932K  26.9M
744 vim          0.0%  0:00.02   1    14    18   628K  1.31M  2.16M  27.7M
729 lookupd      0.0%  0:00.06   2    34    39   472K   996K  1.54M  28.5M
[...]
elliot-lees-computer:/etc/lookupd elliot$ top -l1|grep lookupd
729 lookupd      0.0%  0:00.06   2    34    39   472K   996K  1.54M  28.5M
elliot-lees-computer:/etc/lookupd elliot$ kill -HUP 729
-bash: kill: (729) - Operation not permitted
elliot-lees-computer:/etc/lookupd elliot$ sudo kill -HUP 729
elliot-lees-computer:/etc/lookupd elliot$ ping test5.invisionplus.net
PING test5.invisionplus.net (192.168.1.102): 56 data bytes

Success!

Actually, I used a different method for setting my LookupOrder, which also seems to work. It’s described here on net neurotic.net.

This entry was posted on Tuesday, October 2nd, 2007 at 2:19 pm and is filed under Apple, Internet/DNS, Web Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply