2011
12.06

I had an issue today with a Linux box we shipped to an international office that uses a separate domain name to our Head Office. We enabled zone transfers on the local DNS servers in order to give access to the required services, however we still needed to tell the Linux box which domain names to append whilst performing the name lookups and once that was done we needed to write protect the /etc/resolv.conf file so that the changes would not be overwritten after the next reboot. The necessary config options were as follows:

  • domain – The local domain name
  • search – The domains to search (domain suffix to append)
  • nameserver – The name lookup servers to use

cat /etc/resolv.conf
domain localdomain.com
search localdomain.com
search seconddomain.com
nameserver 192.168.0.254
nameserver 192.168.0.253
nameserver 4.2.2.2

Once all changes have been made and you would like to write protect the /etc/resolv.conf file from any changes being made, you can do so with the following command:
sudo chattr +i /etc/resolv.conf
To remove the write protection, the command is as follows:
sudo chattr -i /etc/resolv.conf

No Comment.

Add Your Comment