2
1
I'm trying to set up dnsmasq, so I can create custom hostnames over an OpenVPN server. So that when a machine connects hostnames will point to resources located on the OpenVPN host or network.
So for example the /etc/hosts file on the server looks like the following:
db.private.resource 10.8.0.1
app.private.resource 10.8.0.1
Getting the client to use the tunnel for DNS lookup is pretty straightforward. On the server.conf file I have:
push "dhcp-option DNS 10.8.0.1"
And in the client config I have:
dhcp-option DNS 10.8.0.1
And I can verify that the client is using OpenVPN as its DNS when connected by running:
# dnsmasq --no-daemon -q
On the command line, and ping from the client to verify that the client is indeed sending DNS lookup requests to the OpenVPN server over the tunnel, and that the OpenVPN server is indeed handling the requests.
The problem is that when I try to ping the db.private.resource
host that I defined, I get:
dnsmasq: query[A] db.private.resource from 10.8.0.2
dnsmasq: config db.private.resource is NXDOMAIN
From the output of dnsmasq. So for what ever reason it doesn't seem to be returning the values I defined in /etc/hosts. And what amazes me is that even when I run dnsmasq with an added address parameter, I still get the above result.
# dnsmasq --no-daemon -q --address=/db.private.resource/10.8.0.1/
dnsmasq: query[A] db.private.resource from 10.8.0.2
dnsmasq: config db.private.resource is NXDOMAIN
Is there any thing that looks wrong from this result?