[ubuntu-us-ut] Someone is re-writing my /etc/resolv.conf

Jason Edwards jtanium at gmail.com
Thu Dec 20 19:46:59 GMT 2007


This is a total hack, but I add the 'i' attribute:

jedwards at linuxbox:~$ sudo -s
root at linuxbox:~# lsattr /etc/resolv.conf
------------------ /etc/resolv.conf
root at linuxbox:~# chattr +i /etc/resolv.conf
root at linuxbox:~# lsattr /etc/resolv.conf
----i------------- /etc/resolv.conf
root at linuxbox:~# echo "nameserver 198.60.22.2" >> /etc/resolv.conf
bash: /etc/resolv.conf: Permission denied
root at linuxbox:~#

I'm interested to hear the correct way to do this...

Jason

On Dec 20, 2007 12:16 PM, Joseph Hall <joseph at thatworks.com> wrote:
> IF you were running Red Hat (and I realize that you're not) then you
> could edit the config file for that interface (i.e.
> /etc/sysconfig/network-scripts/ifcfg-eth0) and add a line that says
> "PEERDNS=no". That would tell the dhcp client not to overwrite the
> /etc/resolv.conf file.
>
> But you're not running Red Hat. You're running Ubuntu, and it uses a
> single /etc/network/interfaces file for all of the interfaces. But I'm
> 90% certain there's a similar option in Ubuntu. Perhaps the Ubuntu
> Utah folk would know?
>
> --
> Joseph
> http://blog.josephhall.com/
>
> --
> ubuntu-us-ut mailing list
> ubuntu-us-ut at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-us-ut
>



More information about the ubuntu-us-ut mailing list