Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Resolve VPN local hostnames without killing the root hostname?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Resolve VPN local hostnames without killing the root hostname? (Read 1634 times)
baz
Jr. Member
Posts: 52
Karma: 1
Resolve VPN local hostnames without killing the root hostname?
«
on:
December 04, 2021, 11:25:43 pm »
I have an OpenVPN server at siteA (
a.example.com
) and a peer client network at siteB (
b.example.com
). They find each other over the internet by resolving their public domains to their public WAN IP addresses then connect to form a private VPN network. The domains are registered at Cloudflare, and the public IP addresses come from Cloudflare's DNS servers. The OpenVPN connection is a "Peer to Peer (SSL/TLS)" tunnel.
Once the sites are connected through VPN, if I am at siteB, I cannot connect to services at siteA using their hostnames like
service1.siteA.example.com
. Instead I have to use the services' IPs at siteA, for example:
192.168.0.10
.
To solve this I can set a "domain override" in unbound at siteB that tells it that
a.example.com
should be resolved using siteA's DNS server at
192.168.0.1
. This will get everything to work properly and allow me to access services using their hostnames:
service1.siteA.example.com ... service99.siteA.example.com
However if the VPN disconnects, the sites will not be able to reconnect because they can no longer find each other over the internet using public DNS since the DNS is being overriden. I would have to disable the override to get it working.
I need to somehow let the subdomains resolve locally but keep the root domain resolving over the internet - or something completely different to get this to work.
Any ideas?
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Resolve VPN local hostnames without killing the root hostname?