Testing DNS resolution with Go

The scope of this article is to provide a simple solution to measure DNS resolution and latency in a continuous loopback with logging capabilities.

The script is written in Golang, it can be run with the following command, or it can be compiled on the platform when needs to run

The script is accepting command line arguments for the hostnamea and delay between tests. It can be run as follows

It will display the A records of the domain name, IP address associated with that domain, specific resolve time for that hostname and also global resolve time for all the provided domains. For any failure in DNS resolution, it will write the failed domain name along with the timestamp in a local file dnsreq.log.

GitHub Repository: https://github.com/OvidiuBorlean/go-lookup

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store