-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Automatically fall back to IPv6 if host has no IPv4 addresses #864
Comments
Hi there @artizirk ! Thanks for the suggestion. What would be the expected behaviour if both IPv4 and IPv6 were available? How would the Trippy uses pub enum LookupIpStrategy {
/// Only query for A (Ipv4) records
Ipv4Only,
/// Only query for AAAA (Ipv6) records
Ipv6Only,
/// Query for A and AAAA in parallel
Ipv4AndIpv6,
/// Query for Ipv6 if that fails, query for Ipv4
Ipv6thenIpv4,
/// Query for Ipv4 if that fails, query for Ipv6 (default)
Ipv4thenIpv6,
} Today, Trippy uses only the
Note that you can change the default in the addr-family = "ipv6" |
This is useful when target host only has a IPv6 address and the user has not forced particular address family. Fixes: fujiapple852#864
This is useful when target host only has a IPv6 address and the user has not forced particular address family. Fixes: fujiapple852#864
Hi! Flags I have created an PR #872 that implements this. |
Hi again @artizirk, thanks for the PR! Thinking about this a bit more, some considerations below. Defaults and overrides
I was a bit uneasy about this at first, as it seems to express an option of favouring Ipv4 over Ipv6. However... Trippy currently supports both the Therefore Trippy is already opinionated as it defaults to Ipv4. However, users are able to change the default opinion in the config file (
Yes I think that is right. The System ResolverThe logic for the The Therefore we would need to make this filtering smarter to respect the various "Fallback" options that Once we have that, it may make sense to only use the Dns Resolve AllTrippy 0.9.0 introduced the If we wanted to support mixing (I'm not sure that I do...) then perhaps the |
@artizirk do you think you can your PR to cover the above? Let me know if anything is unclear, happy to help guide you on chat (i'm fujiapple852 on both Matrix and Discord) |
@artizirk this turned out to be harder than I thought, WIP PR in #928. This PR adds two new values to the # The address family.
#
# Allowed values are:
# ipv4 - Lookup Ipv4 only
# ipv6 - Lookup Ipv6 only
# ipv6-then-ipv4 - Lookup Ipv6 with a fallback to Ipv4
# ipv4-then-ipv6 - Lookup Ipv4 with a fallback to Ipv6 [default]
addr-family = "ipv4-then-ipv6" This covers all resolvers ( There is one outstanding issue with the logic to validate the |
Regarding:
I solved this by adding logic to "downgrade" both |
This feature is now merged in #928 and will be in the |
Currently if you don't specify
-6
argument then trippy fails to resolve addresses for IPv6 only hosts and exits with an error. Default seems to be set IPv4. It would be great if it could use any address family available.The text was updated successfully, but these errors were encountered: