[SOLVED]Cant use DNS server that is behind VPN connection

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
nathanoliver60097
DD-WRT Novice


Joined: 01 Sep 2021
Posts: 6

PostPosted: Thu Sep 02, 2021 14:41    Post subject: [SOLVED]Cant use DNS server that is behind VPN connection Reply with quote
What I'm trying to do:

We purchased a new building and we need to get it connected to our main buildings internal network. I have a SOPHOS UTM9 box that has a VPN server running on it and the goal is to use a router that has a VPN client and use that to bridge the new buildings network into the main building.

Setup:

We purchased a netgear ac1900 router (r7000) and I flashed it with DD-WRT v3.0-r47282 std (08/30/21). I configured the OpenVPN client using

https://imgur.com/a/g5erAAt





https://imgur.com/LGXRe0y



Those were the only changes I made to the stock settings. I am also using the stock DHCP settings. I don't know if those need to be changed to get DNS to work.

Issue:

I can connect to our VPN server, and I can ping IP addresses, but I cannot ping domain names that are behind the VPN connection. I don't get any DNS resolution for our internal network. I did notice in the logs that it does have dhcp-option DNS 10.1.1.6 and dhcp-option DNS 10.1.1.8 being pushed to the vpn client which are our internal DNS servers


Last edited by nathanoliver60097 on Thu Sep 02, 2021 18:20; edited 1 time in total
Sponsor
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Sep 02, 2021 15:22    Post subject: Reply with quote
If you have DNS rebind protection enabled on the dd-wrt router (which I believe is the default), and your DNS server returns private IPs (which is usually the case), then DNSMasq on the dd-wrt router will NOT return those private IPs when you query that DNS server. It's intended to prevent rebind attacks.

Under Services->DNSMasq, try setting "No DNS Rebind" to disable and see if it helps.

Of course, it's better if this is enabled if you intend to access resources on the internet. In that case, you could leave it enabled, and instead add the following directive to Additional DNSMasq Options to allow the return of private IPs only for your workplace domain name.

Code:
rebind-domain-ok=mycompanydomain.com

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
nathanoliver60097
DD-WRT Novice


Joined: 01 Sep 2021
Posts: 6

PostPosted: Thu Sep 02, 2021 15:46    Post subject: Reply with quote
Thanks for the reply eibgrad. I tried just adding

Code:
rebind-domain-ok=mycompanydomain.com


but that didn't change anything. I also tried setting No DNS Rebind to disabled, but that did not work as well and I was also still able to resolve internet names.
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Sep 02, 2021 15:54    Post subject: Reply with quote
Perhaps your DNS server won't respond to any client other than those of the upstream private network. I know Windows, for example, won't respond to any private network other than the one it's running on. for security reasons. Not without making an exception in its firewall. In this case, the "other" IP network in question is that of the tunnel.
_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
nathanoliver60097
DD-WRT Novice


Joined: 01 Sep 2021
Posts: 6

PostPosted: Thu Sep 02, 2021 16:03    Post subject: Reply with quote
I'm not sure. I have the VPN client for SOPHOS on my windows machine at home and I can ping company domain names from it when the client is connected.

I was doing some digging and found that the resolv.conf file on the router search and it has

search hsd1.il.comcast.net
nameserver 192.168.1.1

as its only content. 192.168.1.1 is the IP of the router, and I assume the comcast.net is because that is service that is plugged into the WAN port.
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Sep 02, 2021 16:53    Post subject: Reply with quote
Is in fact 'hsd1.il.comcast.net' the domain name used locally on the upstream network? IOW, are you referencing these devices over the VPN as hostname.hsd1.il.comcast.net, or only by the hostname?
_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
nathanoliver60097
DD-WRT Novice


Joined: 01 Sep 2021
Posts: 6

PostPosted: Thu Sep 02, 2021 17:06    Post subject: Reply with quote
I'm pretty sure hsdl.il.comcast.net is the DNS server for the comcast modem that is connected to the WAN port of the router. Our internal domain name is fabrikind.com. I've tried ping name_of_machine and ping name_of_machine.fabrikind.com and both of those fail.

The setup is:

main building comcast modem -> SOPHOS UTM9 box running VPN server -> internal network
Second building comcast modem -> Netgear Router running VPN client -> internal network

and then the DNS server sits behind the SOPHOS box. We have two, 10.1.1.6 and 10.1.1.8 are thier local IP's.
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Sep 02, 2021 17:25    Post subject: Reply with quote
What happens if you issue a DNS lookup to a hostname (unqualified and qualified w/ the domain name fabrikind.com ) on the router itself (using ssh/telnet) and specifically referencing either of those DNS servers?

nslookup hostname 10.1.1.6
nslookup hostname 10.1.1.8

nslookup hostname.fabrikind.com 10.1.1.6
nslookup hostname.fabrikind.com 10.1.1.8

Do any of these work?

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
nathanoliver60097
DD-WRT Novice


Joined: 01 Sep 2021
Posts: 6

PostPosted: Thu Sep 02, 2021 18:19    Post subject: Reply with quote
nslookup hostname 10.1.1.6 and nslookup hostname 10.1.1.8 both failed but nslookup hostname.fabrikind.com 10.1.1.6 and nslookup hostname.fabrikind.com 10.1.1.8 both worked. Tried pinging machines with the fully qualified name and it now works on my windows machine that's just plugged into the router. I must not have tried the full name when I tested after disabling "No DNS Rebind" as that is still disabled.

I think I should be okay moving forward. I need to debug an issue we are having with IP phones, but at least domain names now resolve. I'm also going to try re-enabling "No DNS Rebind" and adding in the additional directive "rebind-domain-ok=mycompanydomain.com"

Thank you very much for your help.
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Sep 02, 2021 18:49    Post subject: Reply with quote
Just to be clear, it has to be...

rebind-domain-ok=fabrikind.com

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Thu Sep 02, 2021 18:56    Post subject: Reply with quote
P.S. Make sure the domain name on the Setup page of the dd-wrt router is set to your local domain, fabrikind.com. That should change the search parameter accordingly in the resolv.conf file, and any unqualified name should have that appended automatically.
_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
nathanoliver60097
DD-WRT Novice


Joined: 01 Sep 2021
Posts: 6

PostPosted: Thu Sep 02, 2021 19:20    Post subject: Reply with quote
Yeah, I used "rebind-domain-ok=fabrikind.com" in the router. Adding fabrikind.com to the domain field also worked great. I no longer need to fully qualify the names. Thanks again for the help.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum