Subject: Re: Resolving names without dns-suffix on windows

Re: Resolving names without dns-suffix on windows

From: Tommie Gannert <tommie_at_spotify.com>
Date: Mon, 24 Jun 2013 15:30:36 +0200

2013/6/24 Maxim Ruban <m.ruban_at_drweb.com>

> LOCALDOMAIN is Unix-specific environment variable, and in most cases it
> is not defined on Windows,
> so I guess its enough to use LOCALDOMAIN dns-suffix if this env. variable
> was specified intentionally by user, without call to GAA and merging
> results.
> If not specified, call GAA.
>

Ah, so LOCALDOMAIN isn't even a Windows thing...

Then I completely agree c-ares should be using something else. ;)

Looking at (old) code, it seems init_by_resolv_conf() should be extended to
not only get name servers from Windows, but also the search list, which
according to

  http://technet.microsoft.com/en-us/library/dd197418(v=ws.10).aspx

is defined in

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters/SearchList

It sounds better to use an API call to get both name servers and search
list, but I guess that's more prone to Windows version issues. (And reading
registry keys is what the code is doing now.)

I wouldn't know if GAA() is the right function for this or not, but it
seems in Vista they added the ability to return multiple DNS suffixes in it:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa366058(v=vs.85).aspx

That makes me wonder how one was supposed to access the full SearchList
previously.

Do you have the ability to create a patch for it? I would assume Daniel
wouldn't mind a contribution to enhance this behaviour.

-- 
Tommie
Received on 2013-06-24