Linux Tutorials Others

Install and Configure DNS Server aka BIND in CentOS 7 / RHEL 7

main_image_dns

Install

install bind and bind-utils packages using following yum command.

yum install bind bind-utils

guess_linux_dns_bind1

Configure

Once DNS packages are installed we can go ahead and configure DNS. Open and edit /etc/named.conf using your preferred text editor. Make the changes suggested below (or you can use your settings as per your requirements).

vi /etc/named.conf

guess_linux_dns_bind2

modify as following

listen-on port 53 { 127.0.0.1; any; };
allow-query { localhost; any; };
allow-query-cache { localhost; any; };

guess_linux_dns_bind3

we need to test the DNS configuration now for some syntax error before starting the bind service:

named-checkconf /etc/named.conf

guess_linux_dns_bind4
After the syntax verification results seems perfect, restart the named service to take new changes into effect and also make the service to auto start across system boots, and then check its status:

systemctl restart named
systemctl enable named
systemctl status named

guess_linux_dns_bind5

Configuration on client machine

am using mac in windows you can change your self in ipv4 setting.

guess_linux_dns_bind9 guess_linux_dns_bind10 guess_linux_dns_bind11

Testing

guess_linux_dns_bind6 guess_linux_dns_bind7 guess_linux_dns_bind8

Thank you

Leave a Comment