10.4: A shell script to do DNS lookups in the Terminal

Sep 20, '05 08:40:00AM

Contributed by: emzy

Tiger only hintSince I'm using Mac OS X 10.4, controlling DNS lookups via the /etc/resolv.conf file (as explained in this hint) didn't work. Instead, I created this shell script, which I named setdns, to set the DNS temporarily. Remember to make the script executable (chmod 755 setdns).

Hope this helps someone else; it worked for my openvpn setup.

[robg adds: I haven't tested this one, and there's another hint which discusses non-resolv.conf methods of handling DNS that may be worth reading as well...]

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050915124555958