Skip to content

Latest commit

 

History

History
25 lines (11 loc) · 888 Bytes

README.md

File metadata and controls

25 lines (11 loc) · 888 Bytes

GopherDNS

An attempt to build a custom DNS server in Golang for learning purpose.

We need to add domains and thier ipv4 addresses in the domains.yaml file located at root of project.

Run the code as follows : go run main.go --dnsPort 1053 --serverRefreshTime 5 --ttlForResponse 5

The server keeps checking for updated IPs in the file periodically , after every x seconds as set by the serverRefreshTime flag. Hence, it remains updated with IPs set.

Hence it maintains a TTL based cache and look for changes in IPs from file and updates the cache and responds accrodingly.

Following is an example run : command

Following is a response received by DIG command. screenshot