DNS over VPN service

1

1

I have OpenVPN server with few devices connected in (web server, Raspberry Pi, netbook and phones).

I want to create DNS over VPN (custom .vpn domain).

I have done it with dnsmasq and address directive in config file

Example:

address=/home.vpn/10.8.0.1
address=/raspberrypi.vpn/10.8.0.16
...

I changed few settings in OpenVPN server to set custom DNS server for clients and everything is working but I am afraid that dnsmasq is not the best way to do this.

stachu

Posted 2018-08-16T08:51:24.230

Reputation: 111

1dnsmasq is a fine way to do this. – dirkt – 2018-08-16T11:02:09.600

@dirkt I afraid about that because I do not really understand what mean that dnsmasq is a "DNS forwarder". – stachu – 2018-08-16T21:49:03.247

Answers

1

I do not really understand what mean that dnsmasq is a "DNS forwarder".

Look at the man page:

dnsmasq - A lightweight DHCP and caching DNS server.

[...]

Dnsmasq accepts DNS queries and either answers them from a small, local, cache or forwards them to a real, recursive, DNS server. It loads the contents of /etc/hosts so that local hostnames which do not appear in the global DNS can be resolved and also answers DNS queries for DHCP configured hosts.

So if you ask dnsmasq about names in your custom *.vpn domain, it will answer directly. If you ask dnsmasq about other names, like superuser.com, it will forward the query to your ISP's DNS server, cache the answer, and send the answer back.

Which is exactly what you want for your purpose.

dirkt

Posted 2018-08-16T08:51:24.230

Reputation: 11 627