Domain Name System (DNS) is an integral component of any Information Technology (IT) infrastructure. This is a step by step guide for configuring a Red Hat Enterprise Linux 7 public facing DNS server using the BIND software package. Additionally, I would like to add that, for the purposes of this demonstration the zone file created for noelalvarez.net is not pointing to the genuine Internet Protocol (IP) address of the website.
- Enter the command yum update -y to update the server.
- Enter the command yum install bind-chroot bind-utils -y to install bind and DNS utilities.
- Enter the command systemctl start named-chroot to start the DNS server.
- Enter the command systemctl status named-chroot to verify the DNS server is running.
- Enter the command rndc status to verify the name server control utility is running (i.e. server is up and running).
- Enter the command journalctl -u named-chroot to verify there are no errors.
- Enter the command systemctl enable named-chroot to configure BIND to start automatically after a reboot.
- Enter the command cd /etc to navigate to the etc directory.
- Enter the command cp named.conf named.conf.2016111700 to create a copy of the named.conf file.
- Using a text editor, edit the following fields in the name.conf file.
- listen-on port 53 { 127.0.0.1; }; NOTE: Add the Internet Protocl (IP) address of the host.
- allow-query { localhost; }; NOTE: delete localhost; and add any;.
- Add a forward lookup zone.
- Add a reverse lookup zone.
- Enter the command named-checkconf to verify the named.conf file has not syntax errors.
- Enter the command cd /var/named/chroot/var/named/ to navigate to the named directory.
- Using a text editor create the zone file for a forward lookup. In this example it is noelalvarez.net.
- Using a text editor create the zone file for reverse lookup. In this example it is the 67.205.160.0/24 IP address range.
- Enter the command rndc reload to read the changes made to the named.conf and zone files.
- Enter the command cd /etc to navigate to the etc directory.
- Using a text editor, edit the resolv.conf file by adding configuring the server to use it’s IP address for name resolution.
- Enter the command dig noelalvarez.net to query the name server for the A record of noelalvarez.net.
- Additionally, you may use nslookup to query the name server for the various records that were created.
- Lastly, you may query the name server from a host on an external network to verify it is a public facing DNS server.