Opened 7 years ago

Closed 7 years ago

#775 closed Bug / Defect (fixed)

Issue with "register-dns"

Reported by: wla Owned by:
Priority: major Milestone:
Component: Configuration Version: OpenVPN 2.3.12 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords: register-dns opsi
Cc: Selva Nair, Samuli Seppänen

Description

"register-dns" do:

  • C:\Windows\system32\net.exe stop dnscache
  • C:\Windows\system32\net.exe start dnscache
  • C:\Windows\system32\ipconfig.exe /flushdns
  • C:\Windows\system32\ipconfig.exe /registerdns

If the software "opsi" from http://uib.de/ is installed, "net.exe stop dnscache" hangs, because the service opsiclientd.exe depends from dnscache service. If we simulate this from a cmd, we saw that a question "did you will continue ..." wait for answer, but this all runs in background.
As result the tunnel is established, but we have in tasklist 2 processes openvpn.exe and 1 net.exe and net1.exe.

I expect the same issue with other services which depends from service dnscache.

I attach a screenshot (the cmd ist manually started to illustrate the issue):
http://download.schwindt.eu/wla/openvpn_opsi/ko.png

Change History (15)

comment:1 Changed 7 years ago by Gert Döring

Cc: Selva Nair Samuli Seppänen added

Selva, Samuli, any idea how to tackle this?

comment:2 Changed 7 years ago by Selva Nair

I think "net stop dnscache /yes" will get rid of that user prompt about dependent services (not sure /yes is supported on all version of net.exe -- can't find any docs on it).

But, if there are dependent services, net stop will stop those too, but subsequent "net start dnscache" will not restart the dependent service.

I think we should get rid of restarting the dns client service as a part of register-dns. "ipconfig /flushdns" and "ipconfig /registerdns" should be enough to fix the dns registration issues seen on some windows platforms. I've never seen a situation where dns server fails to register without a client service restart. Also, restarting service is too intrusive and takes a while to complete.

comment:3 in reply to:  2 Changed 7 years ago by Gert Döring

Replying to selvanair:

I think we should get rid of restarting the dns client service as a part of register-dns. "ipconfig /flushdns" and "ipconfig /registerdns" should be enough to fix the dns registration issues seen on some windows platforms. I've never seen a situation where dns server fails to register without a client service restart. Also, restarting service is too intrusive and takes a while to complete.

Indeed, this might be the best way forward.

I wonder if we should do this unconditionally ("just get rid of it"), or add a parameter to register-dns - "as is", it would just do /flushdns and /registerdns, but with --register-dns full you get the full blast stuff... or maybe not.

It's not "stone age" stuff, though - James introduced stopping and starting the service in 2010 in commit 75dfe3d7f73279ddefb533f2e3b4a4cce4e9802a (coming from SVN, which is no longer online, meh) - which is about the time when Vista and Win7 were already around...

comment:4 Changed 7 years ago by Selva Nair

As restart service needs admin rights and GUI will not have it going forward, we may not want get to rid of it completely. What about

--restart-dns --> restart the dns client service (add /yes to cmdline too?)
--register-dns --> only ipconfig /flushdns and /registerdns

That said, some feedback from regular Windows users may help decide whether we should keep the current way as the default and add a method to disable the service restart.

Wish we knew why James added the service restart part.

Selva

comment:5 Changed 7 years ago by Samuli Seppänen

I asked James about this.

comment:6 Changed 7 years ago by Samuli Seppänen

An answer from James:

On 29/11/2016 02:16, Samuli Seppänen wrote:
> Hi James,
>
> We recently received a bug report about register-dns not working, because
> an external system service depends on the dnscache service:
>
> <https://community.openvpn.net/openvpn/ticket/775>
>
> As you added the register-dns option, could share some insights on why you
> did it, and why did you implement it as you did?
>
> If possible, respond directly to the Trac ticket .
>
> Thanks!
>
> Samuli 
>
I think it's probably okay to remove the net stop/start dnscache commands
because they are commented out in OpenVPN 3.

James

comment:7 Changed 7 years ago by wla

We tested with an up batch script to have only the 2 commands:

ipconfig /flushdns and
ipconfig /registerdns

This works fine (since 1 day).

I think for DNS issues the restart of service dnscache is not required.

comment:8 Changed 7 years ago by Selva Nair

So what's the consensus? Shall we just remove 'net stop/start dnscache' or make it optional?

comment:9 Changed 7 years ago by Gert Döring

meeting tonight, then decide

comment:10 Changed 7 years ago by Selva Nair

At today's IRC meeting it was decided to remove restarting the dns client service as a part of --register-dns.

Patch sent to the list.

comment:11 Changed 7 years ago by Gert Döring

commit fb56058a98dcc81b34cffbdc46417d672b8926e1
Author: Selva Nair <selva.nair@…>
Date: Wed Nov 30 16:51:36 2016 -0500

Do not restart dns client service as a part of --register-dns processing

thanks :-)

@wla: there are snapshot installers on https://build.openvpn.net/download/snaphots/ - could you grab the latest one and test if it works for you?

comment:12 Changed 7 years ago by wla

404 Not Found ?

comment:13 Changed 7 years ago by wla

ok, typing error: https://build.openvpn.net/downloads/snapshots/ - I will try ...

comment:14 Changed 7 years ago by wla

Tested with:

openvpn-install-2.4_beta2-I904-active-setup.exe - 'net stop/start dnscache' still active!

and

openvpn-install-master-20161201154916-1c587a1112.exe - this works !!!

Respect for fastest reaction!

comment:15 Changed 7 years ago by Gert Döring

Resolution: fixed
Status: newclosed

Thanks for testing & confirming all is good now :-)

Note: See TracTickets for help on using tickets.