I like to make a quick hack to monitor my ISP's DNS functionality, to get some hard data when complaining. What I see is that DNS stops working some minutes some hours, making trouble for a lot of people. But when I call support it works again of course...
Is there an easy way to check if the domain name server system of my pc and network is working ok? I was thinking of invoking the command 'nslookup <anynicedomain> in a loop and see how often it fails. Better ways?
Solved! Go to Solution.
Some more about testing dns functionality. Since the DNS is cached on the pc it is not obvious if a "IP to string" or nslookup will really show that the DNS system is working. One way would be to not reuse domain names for the test, but instead have a very long list of domain names to check... Don't know how do acomplish that in pratice.
I tried to use ping, but that catches also temporary lost packets and I am really only interested in when dns does not respond correctly.
Some googling led me to the windows command
which showes the current cached dns, and each items time to live (TTL). TTL ranged from 30s to >15000s. My current solution is to work with "IP to string" and having a few different domains with different TTL. Will let it run over night and see if it detects anything.
Can anyone think of an easy way to test my program, like forcing the dns to stop working and see that that is detected?
One option would be to use ipconfig /flushdns to clear the local DNS cache before doing the lookup? (but this makes me a little uneasy if doing it regularly and might cause other DNS lookups to slow down etc.)
To 'force' a failure - you could set your DNS servers manually on either your network connection (TCP/IP settings) locally on your PC, or on your router (e.g. on a home network).
Alternatively, can you use another DNS? I use L3's DNS at home - 188.8.131.52 and 184.108.40.206 - and never had an issue.