Bug 1663571 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Valentin Gosu [:valentin] (he/him) from comment #2)
> This seems to be caused by windows due to us calling getaddrinfo.
> I've tried it in all browsers, as well as in a python shell using `socket.gethostbyname` and they all trigger a `mdns` query.
> 
> I am not very sure about how what the [dns lookups](https://searchfox.org/mozilla-central/rev/76a83d0a218837ba6937d6a0fac51cb0008c2334/browser/base/content/browser.js#1419-1420) for single word searches is supposed to do, but I assume it's to disambiguate between search and domain that exists on the local network?
> In this case we can avoid the automatic mDNS lookup if we turn the hostname into FQDN by appending a `.` at the end. Any users that are actually trying to connect to `something.local` when typing `something` will have to add the `.local` part themselves.
> 
> Gijs, what do you think?

Hm. I don't know how common the `.local` case is, maybe Marco has a better feel for it. However, from a quick web search, can we not use `GetAddrInfoEx` and specify we only want DNS, or would that have other drawbacks? ( https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfoexw )
(In reply to Valentin Gosu [:valentin] (he/him) from comment #2)
> This seems to be caused by windows due to us calling getaddrinfo.
> I've tried it in all browsers, as well as in a python shell using `socket.gethostbyname` and they all trigger a `mdns` query.
> 
> I am not very sure about how what the [dns lookups](https://searchfox.org/mozilla-central/rev/76a83d0a218837ba6937d6a0fac51cb0008c2334/browser/base/content/browser.js#1419-1420) for single word searches is supposed to do, but I assume it's to disambiguate between search and domain that exists on the local network?

Edit: forgot to answer this - yes, that's right. We default to searching, and then do the lookup more or less simultaneously. There's a pref to make the lookup happen first, and recently we added a pref to turn it off altogether (as noted earlier). This is all because Windows DNS is... really slow, for some people / reasons? So otherwise, searching single words takes a lot longer, as we have to resolve the DNS first and wait for that.

> In this case we can avoid the automatic mDNS lookup if we turn the hostname into FQDN by appending a `.` at the end. Any users that are actually trying to connect to `something.local` when typing `something` will have to add the `.local` part themselves.
> 
> Gijs, what do you think?

Hm. I don't know how common the `.local` case is, maybe Marco has a better feel for it. However, from a quick web search, can we not use `GetAddrInfoEx` and specify we only want DNS, or would that have other drawbacks? ( https://docs.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfoexw )

Back to Bug 1663571 Comment 3