Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to alter /etc/resolv.conf permanently ?

Hello guys,

for some time I try to find a away to alter /etc/resolv.conf file permanetly but I can't find none.
Everytime my computer reboots Mac OSX the changes the file.

I saw in a post that someone sugests to use the command:
sudo networksetup -setdnsservers "Built-in Ethernet" 1.2.3.4
But that command (networksetup) doesn't exist.

Any ideas?

Mac OS X (10.4.8)

Mac OS X (10.4.8)

Intel iMac Mac OS X (10.4.8)

Posted on May 22, 2007 11:50 AM

Reply
Question marked as Best reply

Posted on May 22, 2007 12:48 PM

resolv.conf is written out as the network settings change, based on the System Preferences.

If you set the appropriate values in System Preferences -> Network then the resolv.conf should get updated accordingly.
6 replies

May 22, 2007 1:17 PM in response to jb.morgado

networksetup is here:

/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/netw orksetup

I make a link to it from /usr/sbin which is in my login PATH so I can use it from the shell.

I'm not sure why, but my /etc/resolv.conf seems to persist. Perhaps I ran System Preferences and it read it in and stored it somewhere. It's a mystery to me. Another thought is to try and put a line in /etc/rc to unlink resolv.conf and link to let's say resolv.conf.O, but I'm unsure of the order of things at the moment.

May 22, 2007 2:23 PM in response to jb.morgado

If you're seeing your router's address, it's probably getting that from your DHCP server. It shouldn't be a problem, especially since most routers act as simple forwarders to whatever DNS server is setup in the router's configuration. If that's the same as what you're trying to set manually, then you won't see any difference.

May 22, 2007 3:35 PM in response to jb.morgado

It's a little strange. I've got my router in resolv.conf too, but it doesn't show up in network preferences. A little while back I had a problem where the router stopped working as a nameserver. I just put it at the bottom of resolv.conf, and it's stayed there, over reboots. Even though it's a link to /var/run/resolv.conf. I'm slightly baffled, although it's fine by me.

How to alter /etc/resolv.conf permanently ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.