(Resolved) Getting Stubby (DNS) to work

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
RagingBullDurham
Level 1
Level 1
Posts: 11
Joined: Sat Oct 07, 2023 1:02 am

(Resolved) Getting Stubby (DNS) to work

Post by RagingBullDurham »

Is networking the correct topic for this?

ISSUE - after fulling installing Stubby on a CLEAN lmde 6 hardware install, I can't seem to get it working:

Code: Select all

$ dig
...
->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60424
flags: qr rd ra ad; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 1
OPT PSEUDOSECTION:
EDNS: version: 0, flags:; udp: 4096

SERVER: 208.67.222.222#53(208.67.222.222) (UDP)  #STILL USING DEFAULT INSTALL OF OPENDNS SERVERS
HOW DO I GET MY SYSTEM TO USE THE DNS SERVERS I SET UP WITH STUBBY?

WHAT I DID/CONFIRMED:

From a CLEAN OS install:

Code: Select all

sudo apt install stubby
I started and confirmed stubby was running.

Code: Select all

$ sudo systemctl start stubby
$ sudo systemctl enable stubby
$ sudo systemctl status stubby
...
     Loaded: loaded (/lib/systemd/system/stubby.service; enabled; preset: enabled)
     Active: active (running) since Wed 2023-11-01 10:55:02 PDT; 14min ago
...
I restarted Network Manager and confirmed stubby was listening:

Code: Select all

$ sudo systemctl restart NetworkManager
$ sudo netstat -lntpu | grep stubby
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      936/stubby
tcp6       0      0 ::1:53                  :::*                    LISTEN      936/stubby
udp        0      0 127.0.0.1:53            0.0.0.0:*                           936/stubby
udp6       0      0 ::1:53                  :::*                                936/stubby
I confirmed that my configs were included in the current stubby running:

Code: Select all

$ sudo stubby -i
...
"upstream_recursive_servers"
{
        "address_data": <bindata for 145.100.185.15>,
        "address_type": <bindata of "IPv4">,
        "tls_auth_name": <bindata of "dnsovertls.sinodun.com">,
        "tls_pubkey_pinset":
        [
          {
            "digest": <bindata of "sha256">,
            "value": <bindata of 62lKu9HsDVbyiPenApnc4sfmSYTHOVfFgL3pyB+cBL4=>
          }
        ]
      },
      {
        "address_data": <bindata for 145.100.185.16>,
        "address_type": <bindata of "IPv4">,
        "tls_auth_name": <bindata of "dnsovertls1.sinodun.com">,
        "tls_pubkey_pinset":
        [
          {
            "digest": <bindata of "sha256">,
            "value": <bindata of cE2ecALeE5B+urJhDrJlVFmf38cJLAvqekONvjvpqUA=>
          }
        ]
      },
 ...
Result: Config file syntax is valid.
And dig gives me the default OpenDNS results instead of the results from the stubby.yml file.

ANY THOUGHTS?
Last edited by RagingBullDurham on Fri Nov 03, 2023 2:49 am, edited 1 time in total.
RagingBullDurham
Level 1
Level 1
Posts: 11
Joined: Sat Oct 07, 2023 1:02 am

Re: Getting Stubby (DNS) to work

Post by RagingBullDurham »

This is resolved.
You need to set the name sever to point to 127.0.0.1 - that is where stubby is listening.

Won't go into details here, but simply install resolvconf and use it to set the nameserver to 127.0.0.1

Great article is here.

Hope that helps.
t42
Level 11
Level 11
Posts: 3747
Joined: Mon Jan 20, 2014 6:48 pm

Re: (Resolved) Getting Stubby (DNS) to work

Post by t42 »

I think it's too much to install resolvconf framework, it's enough to set DNS server to 127.0.0.1 with Network Manager.
And further than that to migrate from resolvconf I'm using dnsmasq as a DNS caching daemon (see my tutorial
DNS over TLS (DOT) Queries and DNS cache using Stubby and DNSMASQ )
-=t42=-
Post Reply

Return to “Networking”