How to Install CoreDNS on EndeavourOS Latest

CoreDNS is a lightweight and versatile DNS server that can be used to serve DNS queries on your network. In this tutorial, we'll walk you through the steps to install CoreDNS on EndeavourOS Latest.

Prerequisites

Before we get started, make sure you have a fresh install of EndeavourOS and a user account with sudo privileges.

Step 1: Installing CoreDNS

To install CoreDNS, we'll first need to add the official CoreDNS repository to our system repository list. Open a terminal and type the following commands:

sudo pacman -S curl
curl -o /etc/pacman.d/coredns_repo 'https://aur.archlinux.org/cgit/aur.git/plain/coredns_repo?h=coredns'
sudo pacman -Syu
sudo pacman -S coredns

Step 2: Configuring CoreDNS

Once CoreDNS is installed, we'll need to configure it to work with our network. We can do this by creating a configuration file in /etc/coredns/ directory.

First, create a new directory for your CoreDNS configuration file:

sudo mkdir /etc/coredns
sudo touch /etc/coredns/Corefile

Next, open the CoreDNS configuration file using your preferred text editor:

sudo nano /etc/coredns/Corefile

This will open an empty configuration file. We'll need to add some configuration to it. For example:

. {
    forward . 8.8.8.8
}

This configuration forwards all DNS queries to Google's public DNS server at 8.8.8.8. You can modify this configuration to suit your needs.

Save and exit the file.

Step 3: Starting CoreDNS

With the CoreDNS configuration file in place, we can start the CoreDNS service using the following command:

sudo systemctl start coredns

You can check the status of the service using the following command:

sudo systemctl status coredns

Step 4: Making CoreDNS a Systemd Service

To make CoreDNS a systemd service, we need to create a systemd unit file. Open your text editor again and add the following configuration:

[Unit]
Description=CoreDNS DNS server
After=network.target

[Service]
ExecStart=/usr/bin/coredns -conf /etc/coredns/Corefile -quiet

[Install]
WantedBy=multi-user.target

Save the file as /etc/systemd/system/coredns.service.

Next, reload systemd and enable the CoreDNS service:

sudo systemctl daemon-reload
sudo systemctl enable coredns.service

Now, CoreDNS will start automatically at boot.

Conclusion

In this tutorial, you learned how to install and configure CoreDNS on EndeavourOS Latest. With CoreDNS installed and configured, your network can now benefit from a lightweight and versatile DNS server.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!