Linux DNS Networking

DNS client on Linux:
  • /etc/resolv.conf specifies the nameservers for resolver lookups. The order of lookup is sequential and accordance to DNS protocol. Local and global DNS entries are added here. Please be advised that these settings could be overwritten by system updates and even reboots. The proper way of inserting persistent DNS records onto resolv.conf is
    vim /etc/resolvconf/resolv.conf.d/head >> insert a record such as: nameserver [LOCAL_DNS_IP] >> save file: wq + enter >> Regenerate resolv.config with: sudo resolvconf -u
  • /etc/hosts file is typically used for only administrative purposes and internal network functions of limited scope. Singular entries associating names with IPs are sometimes added here.
  • /etc/nsswitch.conf specifies the lookup order, to be used in conjunction with the hosts entry.
  • /etc/network/interfaces is the manual IP Address configuration method (typically for servers). Here is a sample of an edit of this file:
    iface eth0 inet static
        address 10.10.30.X
        netmask 255.255.255.0
        gateway 10.10.30.1
        dns-search kimconnect.com
        dns-nameservers 10.10.20.1 10.10.20.2
Lastly, any changes to network configurations should be followed by this command: service network-manager restart

Leave a Reply

Your email address will not be published. Required fields are marked *