Question regarding local name resolution in Proxmox VE

yummiweb

Member
Sep 29, 2019
18
2
23
54
I would like to have Proxmox resolve its local name itself, without querying an external DNS. A (common) Debian system should actually be able to do this. However, my PVE (a Debian "onTop" installation) doesn't do that.

My PVE has (as an example) the following names in the
"/etc/hosts" are entered:

127.0.0.1 localhost
192.168.1.1 pve.domain.org pve
192.168.100.100 pve100.local pve100

"host pve", "host pve100" and "host pve100.local" ("host pve" also) each return:
"Host {yxz} not found: 3(NXDOMAIN)"

This is initially correct because external name servers are entered in "/etc/resolv.conf", which of course cannot resolve internal names.

However, according to "/etc/nsswitch.conf" the PVE is instructed to
first query its local entries (files) and only then the DNS from "/etc/resolv.conf":

passwd: files systemd sss
group: files systemd sss
shadow: files sss
gshadow: files
hosts: files mdns4_minimal [NOTFOUND=return] dns
networks: files
protocols: db files
services: db files sss
ethers: db files
rpc: db files
netgroup: nis sss
sudoers: files sss

However, when making requests via "host", the external DNS is apparently queried and the local entries in "/etc/hosts" are apparently ignored.

However, queries via "getent hosts" provide correct answers, and the "/etc/hosts" is apparently also evaluated correctly by the PVE to the extent that the host name of the PVE ("hostname -f") appears to be correct:
pve.domain.org
(but only the first line)

Is this behavior correct so far?
How do I get Proxmox to resolve its own name without having to query a separate DNS?

Thank you very much and greetings
 
Last edited:
Hi,
looking at the manpage of host, it explicitly resolves hostnames via dns queries, ignoring the /etc/hosts file. The same goes for dig and nslookup.
If you are able to ping it by it's hostname, everything is fine.
 
Hi,
looking at the manpage of host, it explicitly resolves hostnames via dns queries, ignoring the /etc/hosts file. The same goes for dig and nslookup.
If you are able to ping it by it's hostname, everything is fine.
You're absolutely right, "host" apparently only queries DNS. Ping apparently also resolves locally from files.

But: The actual problem has not been solved because, for example, locally running services do not resolve correctly.

Specifically, I have a "nut" server running. But it doesn't work properly if it doesn't find itself - which it does (should do) by name and not by IP. But “Nut” cannot be found via the host name because it is obviously resolved via DNS.

I haven't tried any other services or commands yet.
 

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!