Re: howto lock DNS number in /etc/resolv.conf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 20 Aug 2011 20:36:55 -0400
james tate wrote:

> How can I lock down DNS nameserver in /etc/resolv.conf , every time I 
> reboot the DNS is changed ?

Two ways: Edit the /etc/sysconfig/network-scripts/ifcfg-<whatever>
script for the interface associated with the router providing the
bad info and add the line:

PEERDNS=no

You might have to reboot a couple of times after that to get the
network properly shutdown and restarted with the PEERDNS=no
line in place.

After the reboots, it should be safe to manually edit /etc/resolv.conf
and the contents should remain undisturbed from that point on.

If that doesn't fix it, there is always the big hammer:

Edit /etc/resolv.conf the way you want it, then do:

chattr +i /etc/resolv.conf

That sets the "immutable" attribute so even root can't modify
the file. (If you ever want to modify it again, you'll need
to do chattr -i first).

P.S. This only works for redhat based distros. The rules to
achieve the same PEERDNS=no effect on other distros vary wildly
(the most wacko being opensuse).
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux