Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to host some websites behind a VPN and I need some help with the finer points of the configuration. Thus far I've settled on OpenVPN + Bind9 and I want to configure the domains like this:

External DNS


I want to be able to connect to the vpn using 'vpn.example.com'. Once connected I then want to be able to resolve anything which is '*.vpn.example.com' with the DNS server sitting behind the VPN.

I know that OpenVPN can push DNS servers to clients when they connect. I am having trouble though with the DNS config, both internal and external. I've gone through a few tutorials etc. and tried to reason about it myself but I'm not getting anywhere.

So my main question would be does the above configuration make sense? If so, any general pointers or examples would be greatly appreciated.

Here's what I've tried so far based on this tutorial (I've redacted my domain with example.com). When I try the tests with dig at the end to check the resolution is working it fails.


$TTL 15m
vpn.example.com. IN    SOA     ns.vpn.example.com.   webadmin@example.com. (
                                            2009010910 ;serial
                                            900 ;refresh
                                            900 ;retry
                                            900 ;expire
                                            900 ;minimum TTL
vpn.example.com.       IN NS   ns.vpn.example.com.
ns                     IN A
test                   IN A
share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.