Setting Up DNS Server On CentOS 7 | Unixmen

to get the first DNS SERVER (IP only) : cat /etc/resolv.conf |grep -i '^nameserver'|head -n1|cut -d ' ' -f2 cat will output DNS config; grep filters only nameserver; head will keep only the first row/instance; cut take the ip part of the row (second column with ' ' as separator) To put DNS ip in an environment variable, you could use as follow: Command-line to list DNS servers used by my system - Ask cat /etc/resolv.conf should show your DNS servers. You may not modify the resolv.conf directly with Ubuntu 12.04. If you need to change them though, you can add new DNS servers in your /etc/network/interfaces file by adding the following: How to Find DNS (Domain Name Server) Records On Linux

cat /etc/resolv.conf should show your DNS servers. You may not modify the resolv.conf directly with Ubuntu 12.04. If you need to change them though, you can add new DNS servers in your /etc/network/interfaces file by adding the following:

to get the first DNS SERVER (IP only) : cat /etc/resolv.conf |grep -i '^nameserver'|head -n1|cut -d ' ' -f2 cat will output DNS config; grep filters only nameserver; head will keep only the first row/instance; cut take the ip part of the row (second column with ' ' as separator) To put DNS ip in an environment variable, you could use as follow: Command-line to list DNS servers used by my system - Ask

Jan 12, 2015

Regardless of the distribution of Linux that you are using (such as Ubuntu, CentOS, Debian, Arch, Redhat, etc), the process of determining what DNS servers are currently being used for domain name resolution is the same. To determine what DNS servers are being used, you simply need to view the contents of the “/etc/resolv.conf” file. How to configure DNS Server in Linux bindand caching-nameserverrpm is required to configure dns. check them for install if not found install them. set hostname to server.example.comand ip address to 192.168.0.254. main configuration file for dns server is named.conf. By default this file is not created in /var/named/chroot/etc/ directory.