Hi,

On Mon, Mar 7, 2016 at 3:04 AM, Gert Doering <g...@greenie.muc.de> wrote:

> > Then its only register-dns that remains...
>
> Yep.  Its semantics are not totally clear to me (the code does more, like
> turn off dns cache off/on) and I have no idea whether there's a real API
> for that...


Yes, it does much more than "ipconfig /registerdns": it restarts dns
service, flushes the dns cache, and then does registerdns. Looks like
someone decided to throw everything at it. In my own very limited  tests
I've never seen anything more than registerdns needed to get the DNS server
registered. In fact, a manual "dhcp /renew" after the connection comes up
also appears to do the job: this is not the same as  the --dhcp-renew
option, though.

But I haven't tested any of this beyond a single windows 7 machine, so cant
say for use that ipconfig /registerdns or dhcp renew is enough. Considering
that many folks appear to be dependent on this option, we have to keep it
as is, I guess.

AFAIK,  there is no API for either of these. There are some undocumented
calls like DnsFlushReseolverCache in dnsapi.dll but there are no official
docs on them. The service can be started and restarted using API but its no
less pain than using "net stop" and "net start"

I suppose we need to just queue this request to the service and let it do
it asynchronously in a separate thread. Which is not very unlike the
current fork_to_self approach. It shouldn't be hard to add that to
interactive.c

Selva

Reply via email to