audetto
Posts: 42
Joined: Fri Feb 28, 2014 8:44 pm

DNS Resolution on Raspbian

Fri May 01, 2020 9:40 am

I am trying to setup a pi3 B+ as a router and cannot really understand how DNS resolution works in raspbian.
Before doing any router business, I am just trying to understand how dns resolution work on a pi.

/etc/resolv.conf contains

# Generated by resolvconf
nameserver 127.0.0.1

But when I try to use resolvectl I get

Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.

and more oddly

systemd-resolved is not running.

On Ubuntu I have the same .conf file, but resolvectl works and the service is active.

So how does this work on a normal Pi? using a fully updated Raspbian.

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: DNS Resolution on Raspbian

Fri May 01, 2020 9:42 am

Have you got pihole installed? Are you running dnsmasq for any reason?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

audetto
Posts: 42
Joined: Fri Feb 28, 2014 8:44 pm

Re: DNS Resolution on Raspbian

Fri May 01, 2020 10:30 am

I do.
I had left dnsmasq on for wlan0 which I thought would not cause issues.
But interaction between dnsmasqd and resolved is a common topic of questions.

Thank you, need to do more homework.

audetto
Posts: 42
Joined: Fri Feb 28, 2014 8:44 pm

Re: DNS Resolution on Raspbian

Sun May 03, 2020 7:49 am

I made some progress (and changed vpn provider for other reasons).

Everything works but I have no idea why.
Reading some tutorials

https://wiki.archlinux.org/index.php/OpenVPN#DNS

it seems that one has to do a few steps to get DNS from the OpenVPN server.
I just run openvpn (the client) and everything works out of the box.
With the previous provider it did not happen.

And it is definitely not using the DNS server of my ISP (I can tell because it is able to resolve some names blocked by my ISP).
This is true for the pi itself and wifi clients via dhcp.

Feels a lot like magic but it works.

Regards

Return to “Advanced users”