Coding System.Net.Dns Flush Cache Issues I was attempting to use the System.Net.Dns class query a host and check for an expected value. I quickly realized that DNS caching was causing issues. This lead me down an interesting path. The original code I was writing looked something like