Skip to content

resolve: always synthesize local hostname record#24750

Open
gbsf wants to merge 1 commit intosystemd:mainfrom
gbsf:fix-hostname-query
Open

resolve: always synthesize local hostname record#24750
gbsf wants to merge 1 commit intosystemd:mainfrom
gbsf:fix-hostname-query

Conversation

@gbsf
Copy link
Copy Markdown

@gbsf gbsf commented Sep 19, 2022

resolved was making network queries if search domains were configured.

Fixes #23662

resolved was making network queries if search domains were configured
@poettering
Copy link
Copy Markdown
Member

hmm, so with change hostname --fqdn won't work anymore, will it? we must allow the local hostname to be resolved via classic DNS, so that we can qualify it.

Or what am I missing?

@poettering poettering added the needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer label Sep 27, 2022
@gbsf
Copy link
Copy Markdown
Author

gbsf commented Sep 28, 2022

Indeed, I hadn't considered hostname --fqdn, you are right that it'll stop working with my change.
I might have to solve my problem on the NetworkManager layer then, since DNS-scope-based FQDN hostnames seem a more legitimate use case than working around broken network equipment.
Feel free to close this PR unless someone more knowledgeable has an idea that can make both work.

But at the very least I think the documentation could be improved, because currently it says:

SYNTHETIC RECORDS
systemd-resolved synthesizes DNS resource records (RRs) for the following cases:
• The local, configured hostname is resolved to all locally configured IP addresses ordered by their scope, or — if none are configured — the IPv4 address 127.0.0.2 (which is on the local loopback interface) and the IPv6 address ::1 (which is the local host).
[…]
PROTOCOLS AND ROUTING
The lookup requests that systemd-resolved.service receives are routed to the available DNS servers, LLMNR, and MulticastDNS interfaces according to the following rules:
• Names for which synthetic records are generated (the local hostname, "localhost" and "localdomain", local gateway, as listed in the previous section) and addresses configured in /etc/hosts are never routed to the network and a reply is sent immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-reporter-feedback ❓ There's an unanswered question, the reporter needs to answer resolve

Development

Successfully merging this pull request may close these issues.

resolve: a network query is made for the hostname when search domains are configured

2 participants