k8s.github.io

Pre-requisite CoreDNS

In this section, we will take a look at CoreDNS

Installation of CoreDNS

$ wget https://github.com/coredns/coredns/releases/download/v1.7.0/coredns_1.7.0_linux_amd64.tgz
coredns_1.7.0_linux_amd64.tgz

Extract tar file

$ tar -xzvf coredns_1.7.0_linux_amd64.tgz
coredns

Run the executable file

$ ./coredns

Configuring the hosts file

$ cat > /etc/hosts
192.168.1.10    web
192.168.1.11    db
192.168.1.15    web-1
192.168.1.16    db-1
192.168.1.21    web-2
192.168.1.22    db-2

Adding into the Corefile

$ cat > Corefile
. {
	hosts   /etc/hosts
}

Run the executable file

$ ./coredns

References Docs