Installing and Configuring a Name Server

By default, you can use the BIND installation to configure a caching-only name server using the configuration settings that are provided in the /etc/named.conf file and files that it includes. The following procedure assumes that you either use the default settings or configure new named configuration and zone files.

To configure a name server:

  1. Install the bind package.

    sudo dnf install bind
  2. If NetworkManager is enabled on the system, edit the /etc/sysconfig/network-scripts/ifcfg-interface file, and add the following entry:

    DNS1=127.0.0.1

    This line causes NetworkManager to add the following entry to /etc/resolv.conf when the network service starts:

    nameserver 127.0.0.1

    This entry points the resolver at the local name server.

  3. If you have disabled NetworkManager, edit the /etc/resolv.conf file to include the nameserver 127.0.0.1 entry.

  4. If required, change the named configuration and zone files.

    See Configuring the named Daemon more details.

  5. Configure the system firewall to accept incoming TCP connections to port 53 and incoming UDP datagrams on port 53:

    sudo firewall-cmd --zone=zone --add-port=53/tcp --add-port=53/udp
    sudo firewall-cmd --permanent --zone=zone --add-port=53/tcp --add-port=53/udp

    For more information about securing the firewall, see Oracle Linux 9: Configuring the Firewall.

  6. Restart the NetworkManager service and the named services, and then configure the named service to start following system reboots:

    sudo systemctl restart NetworkManager
    sudo systemctl start named
    sudo systemctl enable named