search domain vs. host file

mikem12

New Member
Feb 24, 2022
20
1
3
34
Hi all,

I'm new with PVE and when creating an LXC that has multiple search domains, it's adding multiple host entries to the /etc/hosts file.

For example in the GUI I set:
Hostname = test
DNS domain = example.com sub1.example.com
DNS servers = 1.2.3.4

I get the following in /etc/hosts:
1.2.3.4 test.example.com test.sub1.example.com test

In /etc/resolv.conf I get:
# --- BEGIN PVE ---
search example.com sub1.example.com
nameserver 1.2.3.4
# --- END PVE ---

The entry in /etc/hosts is wrong. Just because I add an additional search domain, does not mean the host is in that search domain. The idea of a search domain is to be able to hunt for hosts by short name and have it complete the FQDN in order to find a host. That searching has nothing to do with the host running the search, and even worse, could lead to problems if another host with the same name exists in the sub domain.

It is perfectly valid to have two hosts:
test.example.com 1.2.3.4
test.sub1.example.com 4.5.6.7

In which case, proxmox would break things.

It seems that this would be a bug, or maybe bad "functions as designed"

In any case, when creating an LXC, is there a way I can specify host file entries and resolv.conf entries rather than having it auto-generate them?

PS ... from the command line (pct), how can I specify multiple search domains? When I tried "--searchdomain example.com sub1.example.com" it errored with an argument complaint but didn't advise on it and the man page doesn't offer clarification.

Thanks to you all in advance.
 
Thanks, but I don't see anything in the wiki that explains how to specify specific entries, other than not managing the client at all and that's not really what I'd want.

Is there a way to get this identified as a bug and addressed in an upcoming release? My guess is the fix would be a simple change.

Thanks again!
 

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!