Skip to content

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

License

Notifications You must be signed in to change notification settings

hkiiita/GopherDNS

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published