Secure name resolution with DNS-over-TLS

Testing the Implementation

Without validation, configuration changes are just optimistic adjustments. By testing, you ensure that your system uses the specified DNS servers and also that the DNS queries are encrypted, guaranteeing the privacy and security boost DoT promises.

To check the active DNS server, enter

resolvectl status | grep 'Current DNS Server'

If the output matches the specified servers (e.g., 1.1.1.1), it's a preliminary indication things are on track.

Monitoring DNS Traffic for Encryption

DoT is a fundamental security feature for modern networks, but like all systems, DoT requires vigilance. One cannot simply enable and forget; it must be actively monitored.

Before you can monitor traffic on your interface, you need to determine its name using the ip a or ip addr show command:

ip a

This command provides a list of all network interfaces. Typically, wired connections are represented as ethX (e.g., eth0), while wireless connections are often labeled as wlanX (e.g., wlan0).

Look for the interface that has an Inet address (IPv4) or Inet6 address (IPv6) associated with it and is UP. This is typically the active network interface. For instance, the output might look like Listing 1.

Listing 1

Output Showing All Network Interfaces

01 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
02 inet 192.168.1.10/24 brd 192.168.1.255 scope global dynamic eth0

In Listing 1, eth0 is the active network interface.

Monitoring with tcpdump

Now that you've identified your active network interface, utilize tcpdump to monitor DNS traffic. With DoT, monitoring becomes critical to ensure encryption is active. To monitor your DNS traffic, use

sudo tcpdump -i eth0 -n 'port 853'

Replace eth0 with your identified interface.

With the above command, tcpdump intercepts and logs network traffic. If DoT is functional, the domain names accessed won't appear in plaintext. DoT operates via port 853, with encrypted queries passing through it.

While tcpdump is active, access a few websites. Instead of recognizable domain names, you'll largely see encrypted data, verifying the effectiveness of your DoT setup.

The importance of regular traffic monitoring can't be overstated. Monitoring helps identify unusual traffic patterns and potential security breaches, while also ensuring that DoT operates without hitches. Of course, tools like DoT are only part of the solution for maintaining a secure environment. You're still only as safe as your system is, which means you can never escape the need for regular audits and system updates (see the box entitled "Keeping the System Up to Date").

Keeping the System Up to Date

Every system, regardless of its purpose, is a potential target. As such, keeping systems updated is not a luxury, but a necessity.

On Apt-based Linux systems, system and package updates are as easy as

sudo apt update && sudo apt upgrade

Regular updates patch vulnerabilities and ensure optimal performance. This not only keeps the DoT setup solid but the entire system secure.

Periodic security audits are also important. Tools like Nmap or Wireshark will help you monitor and review network traffic. Be sure only necessary ports are open and accessible, and regularly review and update configurations, ensuring that no deprecated protocols or software are in use.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Portmaster

    Security and anonymization play an increasingly important role on the Internet due to the endless appetite of Internet companies for personal data. Portmaster and the Safing Privacy Network will help you protect your privacy – even if you're not a security expert.

  • systemd-networkd

    The new networkd component of the systemd project supports basic network configuration. Despite its early stage of development, one thing is clear: This is a daemon with brains.

  • Professor Knopper's Lab – Removing systemd

    The systemd service manager has been widely adopted by many Linux distros, so why would you want to remove it? The professor reveals why and how.

  • iNet Wireless Daemon

    Intel's iNet wireless daemon offers virtually all of the features found in the obsolete WPA Supplicant, and it is smaller by a factor of 10.

  • Systemd Graphical Tools

    Systemd has won the race, as indicated by the several tools that already offer a service just a mouse click away. We look at six of these tools.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News