- Take me to Lecture
In this section, we will take a look at 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
$ tar -xzvf coredns_1.7.0_linux_amd64.tgz
coredns
- Run the executable file to start a DNS server. By default, it's listen on port 53, which is the default port for a DNS server.
$ ./coredns
- Adding entries into the
/etc/hosts
file. - CoreDNS will pick the ips and names from the
/etc/hosts
file on the server.
$ 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
$ cat > Corefile
. {
hosts /etc/hosts
}
$ ./coredns