Day 3/100daysofK8s

Parthvi Vala
1 min readApr 10, 2021

--

DNS server helps manage name resolutions in an environment with many hostnames and IPs. DNS server is is a dedicated server to do just that mapping. CoreDNS is one of the tool that acts as a server/forwarder.

It’s simple to install. Get the binary, untar it, and run it.

Get the binary
------
wget https://github.com/coredns/coredns/releases/download/v1.8.3/coredns_1.8.3_linux_amd64.tgzUntar it
------
tar -xzvf coredns_1.8.3_linux_amd64.tgz
Run it
-----
./coredns

This starts the server. By default, it uses port 53, but if that one is in use, we can specify another port to use by passing -dns.port flag. It also uses a config file called Corefile by default, but a custom config file can be passed by -conf flag.

To test it, run — dig @127.0.0.1 -p 8080 www.example.com .

Data should appear where the server is running —

./coredns -dns.port 8080
.:8080
CoreDNS-1.8.3
linux/amd64, go1.16, 4293992
[INFO] 127.0.0.1:50937 - 35319 "A IN www.example.com. udp 56 false 4096" NOERROR qr,aa,rd 103 0.000097293s

--

--

No responses yet