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.
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.