How to Install CoreDNS on Fedora Server Latest
CoreDNS is a flexible, extensible DNS server that can serve as a primary or secondary DNS server for domains. In this tutorial, we will learn how to install CoreDNS on Fedora Server Latest.
Step 1: Update the OS
First, update your operating system's package list by running:
sudo dnf update
Step 2: Install CoreDNS
To install CoreDNS, run the following command:
sudo dnf install coredns
After running the command, Fedora will download and install the CoreDNS server.
Step 3: Configure CoreDNS
The CoreDNS configuration file is located at /etc/coredns/Corefile. Open it in a text editor and configure it based on your DNS needs.
For example, to create a simple DNS server that resolves all queries to a specific IP address, add the following configuration to the file:
.:53 {
proxy . 8.8.8.8:53
}
This configuration forwards all DNS queries to Google's DNS server at 8.8.8.8:53.
Step 4: Start and Enable CoreDNS
After configuring CoreDNS, start and enable the service with the following commands:
sudo systemctl start coredns
sudo systemctl enable coredns
Step 5: Verify CoreDNS
To verify that CoreDNS is working correctly, use the following command to query the DNS server:
nslookup example.com localhost
Replace example.com with a domain name you want to query.
If everything is set up correctly, CoreDNS will return the IP address of the specified domain.
Congratulations! You have successfully installed CoreDNS on Fedora Server Latest.