[solved] Enable DNS over TLS on Debian 11

Terminal Velocity

Active Member
Joined
Oct 13, 2021
Messages
305
Reaction score
200
Credits
2,185
What I have tried:

I followed this tutorial for Ubuntu:

And in the ''Testing'' section they suggest to run from the terminal the command:
Code:
sudo tcpdump -i 'port 853'

In my system this command returns the following:
Code:
sudo: tcpdump: command not found

Also I have never install and setup firewall on my computer and I don't know if it has by default.

Any directions are welcomed
 


f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,921
Reaction score
4,411
Credits
43,516
It's telling you the package is not installed, you really don't know how to install a package on Debian?
Code:
sudo apt install tcpdump
 
OP
Terminal Velocity

Terminal Velocity

Active Member
Joined
Oct 13, 2021
Messages
305
Reaction score
200
Credits
2,185
Why you are so surprised? I am new and I use this forum for learning, this is my favorite way of learning, to try to do something and learning on the way. Thank you for the answer

After installing tcpdump the command returns the following:
Code:
$ sudo tcpdump -i 'port 853'

tcpdump: port 853: No such device exists
(SIOCGIFHWADDR: No such device)
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,921
Reaction score
4,411
Credits
43,516
Seeing how long you have been a member I would have thought you would have known how to install a package by now, I was mistaken :)
Code:
$ sudo tcpdump -i 'port 853'

tcpdump: port 853: No such device exists
(SIOCGIFHWADDR: No such device)
The correct format for that is the following.
Code:
tcpdump -i any port 583
The -i stands for interface. I don't think any firewall is installed on Debian by default so you can install what you find easier which is in most cases firewalld or ufw.
 
OP
Terminal Velocity

Terminal Velocity

Active Member
Joined
Oct 13, 2021
Messages
305
Reaction score
200
Credits
2,185
My original username was ''slow learning'' that explains everything

The result of this command is the following:
Code:
# tcpdump -i any port 853
tcpdump: data link type LINUX_SLL2
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,921
Reaction score
4,411
Credits
43,516
That means no traffic is going is being seeing going to port 853, try doing the following.
Code:
tcpdump -i any port 53
Then you will see all dns traffic when you do a query for a website or you can do the following to see all traffic.
Code:
tcpdump -i any
Then you will see all network traffic going on on your pc.

I also just checked it about the firewall thing for Debian, it looks like Debian install "nftables" by default but it isn't enabled so you can just install ufw or firewalld yourself.
To install ufw, enable and start it.
Code:
apt install ufw gufw
systemctl enable ufw --now
or to install firewalld:
Code:
apt install firewalld  firewall-applet
systemctl enable firewalld --now
My original username was ''slow learning'' that explains everything
I didn't know that, Terminal Velocity seems to opposite since it indicates speed ;)
 
OP
Terminal Velocity

Terminal Velocity

Active Member
Joined
Oct 13, 2021
Messages
305
Reaction score
200
Credits
2,185
Both ''tcpdump -i any port 53'' and ''tcpdump -i any'' they fill the terminal with data when I visit a page with the browser...

While ''tcpdump -i any port 853'' does nothing, so this is how we know that my DNS over TLS does not work

So how do I proceed to make DNS over TLS to work? do I need a firewall for that?
I didn't know that, Terminal Velocity seems to opposite since it indicates speed ;)
That's why I changed it, I thought that my old username was slowing me down but it seems the usernames have no effect on me
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,921
Reaction score
4,411
Credits
43,516
I have never tried it before but I did as the steps in the article you linked in your other topic and it just works for me.
1. Edit: /etc/systemd/resolved.conf -> DNSOverTLS=yes
2. Change your dns servers to quad dns servers: 9.9.9.9, 149.112.112.112
3. Restart systemd-resolved and NetworkManager
4. Verify by running and then doing a dns query or opening a website: tcpdump -i andy port 853
 
OP
Terminal Velocity

Terminal Velocity

Active Member
Joined
Oct 13, 2021
Messages
305
Reaction score
200
Credits
2,185
I have followed that article, this is what my DNS looks
Code:
$  cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 9.9.9.9
nameserver 149.112.112.112
And this is what my /etc/systemd/resolved.conf file looks like:
Code:
$ cat /etc/systemd/resolved.conf
#DNS=
#FallbackDNS=
#Domains=
DNSSEC=yes
DNSOverTLS=yes
#MulticastDNS=yes
#LLMNR=yes
#Cache=yes
#DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
I have restarted the machine since yesterday and yet it doesn't work. Might I have a firewall enabled without knowing? what do you think?
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,921
Reaction score
4,411
Credits
43,516
I didn't change anything on my firewall, just have a default firewall configuration, looks like the Quad howto doesn't have Firewall configuration requirement either.
 
OP
Terminal Velocity

Terminal Velocity

Active Member
Joined
Oct 13, 2021
Messages
305
Reaction score
200
Credits
2,185
That option in Firefox is called DNS over HTTPS. I have it enabled. Here we do DNS over TLS which is more complicated if you are unlucky like me

I found out that Systemd-resolved service is not enabled by default in Debian so enebled it with those two comands:
Code:
sudo systemctl enable systemd-resolved.service
sudo systemctl start systemd-resolved.service

Now I have this new info:
Code:
$ resolvectl status
Global
       Protocols: +LLMNR +mDNS +DNSOverTLS DNSSEC=yes/supported
resolv.conf mode: foreign

Link 2 (wwx582c80139263)
    Current Scopes: DNS LLMNR/IPv4
         Protocols: +DefaultRoute +LLMNR -mDNS +DNSOverTLS DNSSEC=yes/supported
Current DNS Server: 9.9.9.9
       DNS Servers: 9.9.9.9 149.112.112.112

Link 3 (wlp1s0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS +DNSOverTLS DNSSEC=yes/supported
 
Last edited:

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
9,035
Reaction score
7,692
Credits
73,737
What benefits do you have with TLS over HTTPS? They're both secure protocols.

On a positive note, you do appear to be defaulting to the DNS server you wanted to use. So, that's good.
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,921
Reaction score
4,411
Credits
43,516
If you're using Firefox, I think it's just a checkmark in the settings somewhere.
I didn't change any setting in my browser to make it work, I would think the Quad howto would have mentioned it if needed.
Code:
$ resolvectl status
Global
       Protocols: +LLMNR +mDNS +DNSOverTLS DNSSEC=yes/supported
resolv.conf mode: foreign

Link 2 (wwx582c80139263)
    Current Scopes: DNS LLMNR/IPv4
         Protocols: +DefaultRoute +LLMNR -mDNS +DNSOverTLS DNSSEC=yes/supported
Current DNS Server: 9.9.9.9
       DNS Servers: 9.9.9.9 149.112.112.112

Link 3 (wlp1s0)
Current Scopes: none
     Protocols: -DefaultRoute +LLMNR -mDNS +DNSOverTLS DNSSEC=yes/supported
It looks like DNSOverTLS is configured since it is mentioned in the list of Protocols active, now when you do a tcpdump on port 853 you should see dns traffic.
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,921
Reaction score
4,411
Credits
43,516
What benefits do you have with TLS over HTTPS? They're both secure protocols.
Also it's more about who do you trust more because even though the traffic is encrypted once your request gets to the dns server they will still be able to see what requests you make.
 
OP
Terminal Velocity

Terminal Velocity

Active Member
Joined
Oct 13, 2021
Messages
305
Reaction score
200
Credits
2,185
It looks like DNSOverTLS is configured since it is mentioned in the list of Protocols active, now when you do a tcpdump on port 853 you should see dns traffic.
Yet, there is no traffic in the port 853, any further ideas are welcomed
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,921
Reaction score
4,411
Credits
43,516
Did you try restarting whatever networkmanager Debian uses, network or NeworkManager?
 

sphen

Well-Known Member
Joined
Dec 12, 2022
Messages
616
Reaction score
551
Credits
7,091
I was the one who mentioned firewall and now I regret it. At the time, I wondered whether a firewall was blocking port 853. Considering that a firewall is not active on @Terminal Velocity's system, the question is moot. Asked and answered.

I recommend NOT installing a firewall until later. A firewall can only cause more problems with blocking communications. Once the existing DNS over TLS question in this thread is resolved, then consider adding a firewall.

The OP, Terminal Velocity, is trying to do something more advanced than most casual Linux users attempt. While I admire the sense of fearlessness and adventure, they seem to be operating without the safety net of having mastered basic Linux usage skills. Considering that Terminal Velocity is not experienced with "apt install ..." what are the chances of success to switch ordinary DNS to DNS over TLS? Maybe the chance of success is decent with a good tutorial, but if something goes wrong, Terminal Velocity appears to lack the basic troubleshooting skills to fall back on. There is nothing wrong with that, but it implies a steeper learning curve to understand and accomplish the goal than Terminal Velocity expected.

I am concerned that this is not going to turn out well, mostly because Linux.org is not a school that can easily bootstrap Terminal Velocity up to a higher experience level. People here will try, but Terminal Velocity should also seek out additional basic learning resources that can help.

By the way, I assume that the reason Terminal Velocity wants to switch from ordinary DNS to DNS over TLS is to prevent their ISP and others from seeing and recording their DNS activity for tracking and monetizing purposes.
 

f33dm3bits

Gold Member
Gold Supporter
Joined
Dec 11, 2019
Messages
5,921
Reaction score
4,411
Credits
43,516
I restarted the computer not the network manager. does that makes a difference?
Yeah that should be enough. What do you see currently when you run tcpdump on port 53 and then browse to a random website?
Code:
tcpdump -i any port 53
 
MALIBAL Linux Laptops

Linux Laptops Custom Built for You
MALIBAL is an innovative computer manufacturer that produces high-performance, custom laptops for Linux.

For more info, visit: https://www.malibal.com

Members online


Top