Skip to content

explicitly do AAAA lookups even if IPv6 is unavailable #1255

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kjetilho
Copy link
Contributor

Resolv will only return IPv6 records if there is a local IPv6 address, and this is problematic since the agent may be in a completely different situation than the master - where this code runs.

Resolv will by default only return AAAA records if there are any IPv6 addresses on the host in question. It does this logic itself, it is not based on getaddrinfo or gai.conf.

Summary

This changes host_to_ip so it uses an explicit DNS lookup for the relevant type of DNS record depending on address family.

Additional Context

Since this code is run on the master, it may be singlestack (typical for Kubernetes deployment), while the agent consuming the catalog is dualstack. This mismatch causes the agent to get the wrong set of firewall rules.

It should be noted that Resolv will never use anything other than DNS to resolve addresses, so addresses in /etc/hosts do not work neither before nor after this patch.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

Resolv will only return IPv6 records if there is a local IPv6 address,
and this is problematic since the agent may be in a completely different
situation than the master - where this code runs.
@kjetilho kjetilho requested a review from a team as a code owner February 14, 2025 12:53
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.

1 participant