Dynamic DNS Registration over VPN?
In our Windows AD domain, we have 2 DCs that also act as our DNS servers which allow the client computers to update their A records
. We have a lot of outside salespeople, so some of our laptops have to go off-site for long periods of time and connect in through our (full tunnel) SSL VPN, using a Fortinet VPN client. DNS over the VPN tunnel works fine, VPN clients are able to resolve local hostnames perfectly.
The problem is that the clients connecting in over the VPN do not update the DNS records with their SSLVPN Adapter IP address. In fact, they don't update the DNS server at all. From my research, I've determined that clients are supposed to send an update to the DNS server "when a change occurs," but that doesn't seem to happen when the SSL VPN adapter connects and gets an IP address.
I have thought about deploying PowerShell scripts to all of the computers that employ the DNSCMD command when it detects that the SSL VPN adapter has an IP address, but that solution is far from ideal, feels overly complicated and very messy. I am hoping there is a simpler solution to this that I have not been able to dig up.
Solution 1:
In the SSLVPN adapter, in TCP/IP properties, DNS, make sure Register this connection's addresses in DNS
actually checked.
Often on a VPN connection it isn't...
Solution 2:
Your clients are not registering their IP addresses with DNS for the simple reason that they're not configure to, when connecting to the VPN. This behavior is called Dynamic DNS Registration, and in Windows, is a per-network adapter setting. Through the GUI, you'd enable or disable this on the network adapter Properties
, the Networking
tab, TCP/IP Properties
, Advanced
, DNS
tab, as shown below.
Fortunately, it's possible to correct this for all your users. Unfortunately, it's not as simple as it should be - there's no built in GPO that controls this specific setting, which leaves this task up to scripts, or manual intervention. Hopefully the manual intervention road needs no real explanation (tell your users to do it, and/or do it for the ones who can't/won't), but there are three approaches to this problem that may merit some explanation.
- Offload the DDNS registration work to your DHCP server.
- This may be a configurable option on your Fortinet (to register DHCP clients with a DNS server you provide).
- Script the DDNS registration on the clients.
- I'm not one to reinvent the wheel, so see Evan Anderson's answer, that includes a script you'd use, to a similar question.
- If you want to roll your own PowerShell script, you'd be looking at the
SetDynamicDNSRegistration
method of theWin32_NetworkAdapterConfiguration
class.
- If you want to roll your own PowerShell script, you'd be looking at the
- I would think the best results would be achieved by combining such a script with a logon or startup GPO, but could be implemented in other or simpler ways as well.
- I'm not one to reinvent the wheel, so see Evan Anderson's answer, that includes a script you'd use, to a similar question.
- Check the VPN client installer documentation to see if this is a configurable option.
- When I had a similar issue at an old job, using the Cisco VPN client, DDNS registration was configurable via a simple config file in the installer package, which I altered to suit our needs and then baked into all our laptop images.