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

Re: Resolving names without dns-suffix on windows

From: Maxim Ruban <m.ruban_at_drweb.com>
Date: Mon, 24 Jun 2013 16:30:07 +0400

Hello,

I've checked it properly and found that gethostname returns only
host-name without dns-prefix
on well configured windows stations (checked with win7-stations),
so I suppose there is no way to deduce dns-prefixes if LOCALDOMAIN
variable not specified and
or hostname not updated manually by user in windows registry
(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Hostname)

I still suggest to obtain dns-prefixes via GetAdaptersAddresses call,
when LOCALDOMAIN and gethostname give nothing.

Kind regards,
Maxim.

ps. please execuse my previous confusing posts.

On 2013-06-19 9:20 PM, Maxim Ruban wrote:
> Hello once again,
>
> Sorry for confusing you - I've missed HAVE_GETHOSTNAME flag when
> compiling c-ares,
> and untrue when saying "gethostname returns name without suffix".
>
> Problem solved, getting domains from GetAdaptersAddresses is not
> necessary.
>
> Kind regards,
> Maxim.
>
> On 2013-06-19 8:08 PM, Maxim Ruban wrote:
>> Hello all,
>>
>> I am unable to resolve short names w/o dns-suffix specified:
>> "shortname.corp.com" is OK, but "shortname" is failed to resolve.
>>
>> Domain list is not provided to c-ares, so by default it tries to init
>> domains list from LOCALDOMAIN environment variable,
>> or get domain from current host name (gethostname).
>>
>> In my case host name returned by gethostname does not contain
>> dns-suffix.
>>
>> I think, it would be good on windows platform to initialize domains
>> list with results of GetAdaptersAddresses call (DnsSuffix field in
>> IP_ADAPTER_ADDRESSES structure)
>> if no domains were deduced from LOCALDOMAIN or gethostname.
>>
>> Please, let me know your opinion on this subject.
>>
>> Kind regards,
>> Maxim.
>>
>>
>
Received on 2013-06-24