A simple Bash script to measure and compare DNS query response times from popular public DNS servers.
Outputs aligned ASCII tables showing raw and sorted results by speed.
This script has been tested on the following Linux distribution:
- Distributor ID: Ubuntu
- Description: Ubuntu 22.04.5 LTS
- Release: 22.04
- Codename: jammy
Note: On this system, /etc/resolv.conf is a symbolic link to /run/systemd/resolve/stub-resolv.conf.
- Tests multiple well-known DNS servers (Cloudflare, Google, Quad9, OpenDNS, AdGuard, ControlD)
- Measures query time to resolve a specified domain (default:
example.com) - Handles no-response cases gracefully by marking them as
NO RESP - Outputs two clean, ASCII-aligned tables:
- Original unsorted results
- Results sorted from fastest to slowest
- Fully ASCII-safe with dynamic column width adjustment
- Cloudflare (1.1.1.1)
- Google Primary (8.8.8.8)
- Google Backup (8.8.4.4)
- Quad9 (9.9.9.9)
- OpenDNS Primary (208.67.222.222)
- OpenDNS Backup (208.67.220.220)
- AdGuard Primary (94.140.14.14)
- AdGuard Backup (94.140.15.15)
- ControlD Primary (76.76.2.0)
- ControlD Backup (76.76.10.0)
./dns-speed-test.sh [domain]domain— Optional. The domain to resolve. Defaults toexample.comif omitted.
You can download the latest version of the DNS Speed Test script from GitHub:
+-----------+-------------+--------+
| Name | IP | Time |
+-----------+-------------+--------+
| Cloudflare| 1.1.1.1 | 12ms|
| Google | 8.8.8.8 | 14ms|
| Quad9 | 9.9.9.9 | NO RESP|
+-----------+-------------+--------+
Sorted (from fastest to slowest):
+-----------+-------------+--------+
| Name | IP | Time |
+-----------+-------------+--------+
| Cloudflare| 1.1.1.1 | 12ms|
| Google | 8.8.8.8 | 14ms|
| Quad9 | 9.9.9.9 | NO RESP|
+-----------+-------------+--------+
- Uses
digto query each DNS server for the provided domain. - Extracts the query time from the
digoutput. - If no response is received within the timeout, marks it as
NO RESPwith a high sort value to appear last. - Prints two tables:
- The original order of DNS servers tested
- Sorted results by ascending query time
bashdig(frombind-utilsordnsutilspackage)
MIT License
DNS Configuration for IONOS VPS (Ubuntu Server)
This How-TO provides a complete, correct, and IONOS‑proof guide on how to enforce Cloudflare DNS (1.1.1.1 / 1.0.0.1) on an IONOS VPS running Ubuntu Server, while keeping the public IP address and gateway assigned via DHCP.
🧠 IONOS VPS Specifics
🔹 DNS Servers Assigned via DHCP
During installation or at boot time, you may see DNS servers such as:
✔️ Official IONOS / 1&1 DNS servers
✔️ Assigned via DHCP
❌ NOT mandatory
IONOS:
systemd-networkdconfigurations➡️ This makes IONOS an excellent provider for advanced network hardening.
🏗️ Typical IONOS VPS Network Stack (Ubuntu Server)
On Ubuntu Server, IONOS almost always uses:
systemd-networkdsystemd-resolvedNetworkManager(not installed)🎯 Goal
📁 Correct Configuration File
Correct file path:
✏️ Exact
viCommandFull File Content
✅ Effective Result on IONOS
IONOS does not overwrite this configuration.
🔍 What Happens at Boot
systemd-networkdactivates interfaceens6systemd-resolveduses:✔️ No silent fallback to ISP DNS
🔄 Apply the Configuration
🧪 IONOS‑Proof Verification
Check Active DNS Resolver
Expected output:
Expected output:
Verify Actual DNS Traffic
✔️ Destination ≠ 212.227. → OK*
🔐 Recommended Hardening (PRO Level)
🔹 DNS‑over‑TLS (Cloudflare)
Edit the file:
Add or modify:
Apply changes:
✔️ Encrypted DNS traffic
✔️ No ISP inspection
🔹 Block Unauthorized DNS (nftables)
✔️ Fully allowed on IONOS
✔️ Prevents DNS leaks
❌ Install
NetworkManager❌ Manually edit
/etc/resolv.conf❌ Configure static IPs without recovery console access
✅ Conclusion
This configuration is:
👉 Ideal DNS configuration for hardened IONOS VPS environments.