Hosts: Cannot Resolve DNS for 5-10 Minutes After Wake

Created on 28 Apr 2018  路  5Comments  路  Source: StevenBlack/hosts

Issue can be seen in detail here

This happens when waking from sleep, hibernation, or just turning the computer on.

Is there any resolution?

Most helpful comment

@dnmTX @ScriptTiger I tried the compressed version with HostsMan and it's working great :) Thanks for all the help!

All 5 comments

Hmm...never had this happened on my pc but i'm still using Anniversary Update here which is stable,anyway,you can try the following:

  1. Download HostMan 4.8.106 with it you can remove all comments,empty lines and compress it if you want to up to 9 domains per line which will make the whole file smaller and hopefully will fix the issue.
  2. @ScriptTiger's repo offering small script to update,remove lines,compress if you want to so you can try it too.
  3. Last but not least you can disable the DNS service see if there is any difference but judging by the link you posted the hosts file is not that big and i think there something else that causing the issue,maybe clean windows install could help.If you can't disable the service there is a workaround:
    Flush the existing DNS cache
    Start > Run (type) regedit
    Navigate to the following location:
    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesDnscacheParameters
    Click Edit > New > DWORD Value (type) MaxCacheTtl
    Click Edit > New > DWORD Value (type) MaxNegativeCacheTtl
    Next right-click on the MaxCacheTtl entry (right pane) and select: Modify and change the value to 1
    The MaxNegativeCacheTtl entry should already have a value of 0 (leave it that way - see screenshot)
    Close Regedit and reboot ...
    This is taken from Microsoft site: https://support.microsoft.com/en-us/help/318803/how-to-disable-client-side-dns-caching-in-windows-xp-and-windows-serve
  4. Probably the best solution.If you using router and can load custom firmware(like Merlin,OpenWrt,DD-Wrt etc.) they all come with "DNSMASQ" preinstalled which is fast lightweight host resolver,this way all the devices will be protected not just your PC.This is what i did and so far so good.

I downloaded HostsMan and tried the MVPS Hosts file, which doesn't take nearly as long to load (maybe 5-10 seconds). I tried this file again, and it brought me back to the 5-10 minute mark again, so the issue definitely lies within it

MVPS is tiny, 464 KB, compared to the hosts files here, the smallest being 1.55 MB. @dnmTX suggested my script, but you could also just download a pre-generated one here:
https://scripttiger.github.io/alts/

Try testing out the compressed and mcompressed formats.

P.S.: @dnmTX, how is that script working out for you? Any notable issues with it?

@ScriptTiger shoot...i forgot about your ready compressed lists that you offering,sorry,ill make sure to mention them next time.
On your other question,script is working just fine(thank you),and it's a big benefit if you are with Windows and using it's DNS service but....as you know i switched to DNSMASQ and there it doesn't make the slightest difference being compressed or not,that thing is so fast that "LARGE" lists like @StevenBlack 's one(being sarcastic here) are appetizers for dnsmasq,not even the main dish(filtering 55774 domains at the present from two merged hosts lists).So i ended up having the router do all the work-cleaning,merging and so on due to the fact that Linux in general have much better tools to do the job.I finalized my little script(see https://github.com/ZeroDot1/CoinBlockerLists/issues/136 somewhere in the middle) and now i just have to SSH to the router and activate it and that's it.Works like charm.But don't get me wrong,your hard work is always appreciated here,your script will help many others Windows users for sure.

P.S. @z0oinks i saw the most benefit with 5 line compression(aka @ScriptTiger 's mcompressed lists),just FYI.

@dnmTX @ScriptTiger I tried the compressed version with HostsMan and it's working great :) Thanks for all the help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onmyouji picture onmyouji  路  3Comments

Laicure picture Laicure  路  3Comments

hyphenized picture hyphenized  路  3Comments

dhavalgoti24 picture dhavalgoti24  路  3Comments

scafroglia93 picture scafroglia93  路  3Comments