[SOLVED] Hight rate of dns queries for PBS from PVE

Etienne Charlier

Well-Known Member
Oct 29, 2018
64
11
48
21
Dear,

I installed adguardhome as my home network dns "server"

I have a homelab with a pve server hosting a couple of vm ( nextcloud, influxdb...)
those vm are backuped to remote PBD instance ( kindly offered by tuxis.nl) and to a local PBS ( lorath-adm.phi8.ovh)

the statistics page of adguardhome show that almos 45% of DNS requests served by adguardhome are for the two PBS hostnames.

Is this normal ?
How/where can I start investigating/diagnosing this issue ?

Thanks in adance
EC

Capture d’écran 2022-11-05 à 12.21.31.png
12:26:18 11/5/2022 monitor.phi8.ovh Type: AAAA, Plain DNS Processed 0.56 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.21%22']172.19.1.21[/URL] 12:26:13 11/5/2022 lorath-adm.phi8.ovh Type: AAAA, Plain DNS Processed 0.41 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL] 12:26:13 11/5/2022 lorath-adm.phi8.ovh Type: A, Plain DNS Processed 0.12 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL] 12:26:13 11/5/2022 pbs001.tuxis.nl Type: AAAA, Plain DNS Processed 0.21 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL] 12:26:13 11/5/2022 pbs001.tuxis.nl Type: A, Plain DNS Processed 0.17 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL] 12:26:13 11/5/2022 pbs001.tuxis.nl Type: AAAA, Plain DNS Processed 0.08 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL] 12:26:13 11/5/2022 pbs001.tuxis.nl Type: A, Plain DNS Processed 0.12 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL] 12:26:08 11/5/2022 monitor.phi8.ovh Type: AAAA, Plain DNS Processed 0.44 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.21%22']172.19.1.21[/URL] 12:26:05 11/5/2022 pbs001.tuxis.nl Type: A, Plain DNS Processed 0.08 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL] 12:26:05 11/5/2022 pbs001.tuxis.nl Type: AAAA, Plain DNS Processed 0.16 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL] 12:26:05 11/5/2022 pbs001.tuxis.nl Type: AAAA, Plain DNS Processed 0.08 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL] Block 12:26:05 11/5/2022 pbs001.tuxis.nl Type: A, Plain DNS Processed 0.13 ms [URL='http://thewall.phi8.ovh:3080/#logs?search=%22172.19.1.100%22']172.19.1.100[/URL]
 
PVE keeps a graph of the storage space and contacts the PBS regularly (and rather often). The PBS is configured with an URL and PVE does not know how often the PBS changes its IP address. Therefore it does a DNS request every time, which is not uncommon (browsers do it all the time when you refresh a webpage). If you are using a caching DNS server then this should not be a problem.
 
I've observed exatly the same (4 req every 10 sec). I've put an entry for the pbs server to the /etc/hosts file of the pve and it is not polluting the AdGuardHome log/stat anymore. I guess that pbs server IP is not changing frequently.
 
I solved this with a new entry on /etc/hosts and a script that executes every hour, just in case Tuxis change there IP.

Just change the website value on the script... chmod +x and add it to a cron job...

Bash:
#!/bin/bash

# Define the website URL and the hosts file path
website="XXXXXXXXXXX.tuxis.nl"
hosts_file="/etc/hosts"

# Use dig to retrieve the current IP address
current_ip=$(dig +short "$website" | grep '^[.0-9]*$')

# Check if the IP address is already in the hosts file
if grep -q "$website" "$hosts_file"; then
    # Get the current IP address from the hosts file
    hosts_ip=$(grep "$website" "$hosts_file" | awk '{print $1}')

    # Compare the current IP with the one in the hosts file
    if [ "$current_ip" != "$hosts_ip" ]; then
        # Update the hosts file with the new IP
        sed -i "s/$hosts_ip.*/$current_ip $website/" "$hosts_file"
        echo "Updated $website in $hosts_file from $hosts_ip to $current_ip"
    else
        echo "No change in IP address."
    fi
else
    # Append the new entry to the hosts file
    echo "$current_ip $website" >> "$hosts_file"
    echo "Added $website to $hosts_file with IP $current_ip"
fi
 
Last edited:
Hi @vdias,
thank you for the script.

Unfortunately I'm pretty new to the proxmox and Linux world. I understand the concept of what you are doing with this script but can't figure out how to create and run it.
Could you please specify that line for a total newbie:
chmod +x and add it to a cron job
What do the shell commands look like?

Thank you,
Hans
 
So a DNS server is supposed to answer DNS queries. The Adguard or PiHole is usually a local DNS server and caches the queries anyway so that they never reach public DNS servers in bulk.

Now building a script to avoid DNS requests is somehow really absurd. You can also avoid creating backups because it takes up traffic and storage space. It's best not to set up any services in the internal network if you're afraid that they can also be used.
 
  • Like
Reactions: HansJerkov

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!