Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable synthesized hostname in systemd-resolved #3451

Merged

Conversation

bcressey
Copy link
Contributor

Issue number:
N/A - reported by @etungsten

Description of changes:
Disable the synthesized hostname feature in systemd-resolved.

Otherwise, the reverse lookup in netdog will return "linux" if no other name can be resolved by DNS. This causes problems when trying to join several nodes to a Kubernetes cluster, since they all attempt to register as "linux".

The expected (historical) behavior is that the system hostname winds up as the primary interface's IP address in this case. This is not ideal and causes other headaches: for example, the short name of the host is the first part of the IP in dotted decimal notation. But in the absence of a setting or reverse DNS, it's at least a potentially predictable and unique identifier.

Testing done:

Before:

bash-5.1# resolvectl query 198.19.33.182
198.19.33.182: linux                           -- link: eth0
               linux.local                     -- link: eth0

-- Information acquired via protocol DNS in 8.5ms.
-- Data is authenticated: yes; Data was acquired via local or encrypted transport: yes
-- Data from: synthetic

After:

bash-5.1# resolvectl query 198.19.16.218
198.19.16.218: resolve call failed: Name '218.16.19.198.in-addr.arpa' not found

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Otherwise, the reverse lookup in `netdog` will return "linux" if no
other name can be resolved by DNS. This causes problems when trying
to join several nodes to a Kubernetes cluster, since they all attempt
to register as "linux".

The expected (historical) behavior is that the system hostname winds
up as the primary interface's IP address in this case. This is not
ideal and causes other headaches: for example, the short name of the
host is the first part of the IP in dotted decimal notation. But in
the absence of a setting or reverse DNS, it's at least a potentially
predictable and unique identifier.

Signed-off-by: Ben Cressey <[email protected]>
Copy link
Contributor

@yeazelm yeazelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix!

@bcressey bcressey merged commit f050989 into bottlerocket-os:develop Sep 13, 2023
48 checks passed
@bcressey bcressey deleted the resolved-not-to-synthesize-hostname branch September 13, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants