Leopard, DNS and NetInfo

Today while trying to add a local host to my relatively-newly-upgraded Leopard laptop, I noticed that Leopard no longer has the NetInfo tools that I had been accustomed to using in the past. I also noticed that modifying /etc/hosts had no real effect on DNS resolution -- it still pulled from the nameserver. I suspected something had changed.

Correct! To add hosts (and other information) to the new NetInfo-equvalent on Leopard, you need to use dscl. As in:

sudo dscl localhost -create /Local/Default/Hosts/enterprise.federation.org IPAddress 192.168.0.1


This works just fine, and I was able to use it to add a local host. Thanks to this posting for pointing in the right direction.

Also, I needed to purge the DNS cache for testing. A new Leopard command, dscacheutil -flushcache did the trick. Thanks to this post and this post for that one.

And now my Leopard networking issues are resolved. What did people do before the Internet existed? :-)

Comments