You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When systemd-resolved is used to resolve names on a system, it does not resolve unqualified hosts (hosts without a domain name) into FQDNs using the machine's domain. For example, if a minion's FQDN is minion.mydomain.com, systemd-resolved will fail to resolve salt as salt.mydomain.com on that machine.
Setup
on-prem machine
VM (Virtualbox, KVM, etc. please specify)
VM running on a cloud service, please be explicit and add details
container (Kubernetes, Docker, containerd, etc. please specify)
or a combination, please be explicit
jails if it is FreeBSD
classic packaging
onedir packaging
used bootstrap to install
Running in a OVH US VPS on Debian 11 amd64. Saltstack 3005.1 from the Saltstack repos. On this machine I disabled cloud-init, changed the FQDN, and installed salt. Nothing else was changed from the Debian 11 install given by OVH.
Steps to Reproduce the behavior
Setup machine that resolves using systemd-resolved, set full FQDN
Install Salt minion 3005.1 on machine
Start salt-minion
Nov 15 21:32:16 some-minion salt-minion[2991]: [ERROR ] DNS lookup or connection check of 'salt' failed.
Nov 15 21:32:16 some-minion salt-minion[2991]: [ERROR ] Master hostname: 'salt' not found or not responsive. Retrying in 30 seconds
Expected behavior
Because the resolver cannot be trusted to attempt to resolve with the machine's domain, minions should try resolving both salt and salt.machinedomain.com at startup.
Screenshots
N/A
Versions Report
salt --versions-report
Salt Version:
Salt: 3005.1Dependency Versions:
cffi: Not Installedcherrypy: Not Installeddateutil: 2.8.1docker-py: Not Installedgitdb: 4.0.5gitpython: 3.1.14Jinja2: 2.11.3libgit2: Not InstalledM2Crypto: Not InstalledMako: Not Installedmsgpack: 1.0.0msgpack-pure: Not Installedmysql-python: Not Installedpycparser: Not Installedpycrypto: Not Installedpycryptodome: 3.9.7pygit2: Not InstalledPython: 3.9.2 (default, Feb 28 2021, 17:03:44)python-gnupg: Not InstalledPyYAML: 5.3.1PyZMQ: 20.0.0smmap: 4.0.0timelib: Not InstalledTornado: 4.5.3ZMQ: 4.3.4System Versions:
dist: debian 11 bullseyelocale: utf-8machine: x86_64release: 5.10.0-19-cloud-amd64system: Linuxversion: Debian GNU/Linux 11 bullseye
Since using unqualified domains goes against spec, it doesn't seem like a good default. However, configuration-less minions are fantastic. Would this be the appropriate place to change it to something like:
importsocketDEFAULT_MASTER_HOSTNAME="salt"deffindDefaultMasterName() ->str:
fqdn=socket.getfqdn()
# If this machine has a domain name, use it instead of unqualified hostnameif"."infqdn:
returnDEFAULT_MASTER_HOSTNAME+"."+fqdn.partition(".")[2]
# Fall back to unqualified hostnamereturnDEFAULT_MASTER_HOSTNAMEDEFAULT_MINION_OPTS=immutabletypes.freeze(
{
"interface": "0.0.0.0",
"master": findDefaultMasterName()
...
Note that simply socket.getfqdn("salt") should not be used here because it actually performs a lookup.
If the above looks good then I will open a pull! Although I'm not sure in which file that function should be defined. Maybe a util file?
DaAwesomeP
changed the title
[BUG] unqualified name resolve for "salt" not consistent
[BUG] Cannot resolve unqualified name "salt"
Nov 16, 2022
Description
When systemd-resolved is used to resolve names on a system, it does not resolve unqualified hosts (hosts without a domain name) into FQDNs using the machine's domain. For example, if a minion's FQDN is
minion.mydomain.com
, systemd-resolved will fail to resolvesalt
assalt.mydomain.com
on that machine.Setup
Running in a OVH US VPS on Debian 11 amd64. Saltstack 3005.1 from the Saltstack repos. On this machine I disabled cloud-init, changed the FQDN, and installed salt. Nothing else was changed from the Debian 11 install given by OVH.
Steps to Reproduce the behavior
Expected behavior
Because the resolver cannot be trusted to attempt to resolve with the machine's domain, minions should try resolving both
salt
andsalt.machinedomain.com
at startup.Screenshots
N/A
Versions Report
salt --versions-report
Additional context
Related: systemd/systemd#2514
See above link, it is apparently the correct functionality for the resolver not to resolve unqualified names.
The text was updated successfully, but these errors were encountered: