Why does it take couple of seconds for DNS resolver to find .local domain specified in etc/hosts

2

(Running Windows 7) This is one of the entries I have in my Windows' etc/hosts file

127.0.0.1 localhost mysite.mike mysite.local

First I noticed that my browser takes always 2.01-2.04s (so 2 seconds) to resolve DNS on mysite.local. Sometimes the browser cached the dns entry but as soon as it expired, the situation happened again. However mysite.mike resolves immediately.

Now I checked if it's only the browser, so I used tracert tool to see how it reacts to dns resolving. The results were the same as in the browser although it took exactly 1s instead of 2s.

~  time tracert -4 mysite.local                                                                                                        
Tracing route to [127.0.0.1]
over a maximum of 30 hops:
  1    <1 ms    <1 ms    <1 ms  [127.0.0.1]
Trace complete.
tracert -4 mysite.local  0.00s user 0.01s system 1% cpu 1.062 total

However

~  time tracert -4 mysite.mike
Tracing route to [127.0.0.1]
over a maximum of 30 hops:
  1    <1 ms    <1 ms    <1 ms  [127.0.0.1]
Trace complete.
tracert -4 mysite.mike  0.00s user 0.01s system 32% cpu 0.047 total

I also noticed that tracert doesn't try to contact the DNS server (like it knows beforehand that both .mike and .local domains are local) on the internet as my FW doesn't trigger information which it does when I try to tracert any other domain such as mysite.other

What causes this 1-2 second delay? Just a side note, it took Internet Explorer 10 seconds to resolve this very domain

Mike

Posted 2018-06-22T19:23:01.637

Reputation: 196

Did you check traffic on ports udp/5353 and udp/5355? – user1686 – 2018-06-22T19:36:13.953

I don't explicitly monitor the traffic but the interactive mode informs me upon connection attempt to allow/deny – Mike – 2018-06-22T19:50:17.510

Sounds like it's trying to resolve it via the mDNS service first, since it ends in ".local". – Ignacio Vazquez-Abrams – 2018-06-22T19:56:57.480

@IgnacioVazquez-Abrams this must have something to do with this. I uninstalled Apple's Bonjour (must have came with itunes) and the "problem" is gone. – Mike – 2018-06-22T20:04:45.513

No answers