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

Configure doggo to look up A *and* AAAA when not asked for any specific record type #124

Open
nogweii opened this issue Jul 1, 2024 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@nogweii
Copy link

nogweii commented Jul 1, 2024

When I type doggo example.com, I would like to see both A and AAAA records (properly indicated, of course). That's pretty similar to what most software does (thanks to them delegating to glibc, etc).

Probably as a CLI flag?

@mr-karan
Copy link
Owner

mr-karan commented Jul 2, 2024

It's a bit arbitrary to show AAAA records along with A. If it makes sense, you can alias/make a bash function to do the same? doggo A AAAA

@nogweii
Copy link
Author

nogweii commented Jul 2, 2024

I'd also argue it's a bit arbitrary to only show A. Especially with the recent pushes to move more and more to IPv6, I think it's time to re-evaluate that particular default. IPv4 won't go away, so showing only AAAA and not A wouldn't be correct.

I want to refer back to glibc's getnameinfo(3), it looks up both record types for the calling application. Which means most applications implicitly use IPv6 without any special configuration, and could cause confusion with dns tools: doggo example.com returns an IPv4 address but the application actually connected to an IPv6 address. (How often that actually matters is probably quite rare these days. Most dual-stacks are the same host.)

I'm not expecting the default to change yet (even if I think it should), but was asking for a way to easily enable showing both-by-default. I see three options:

  1. Actually change the default
  2. Add a CLI flag that sets this, maybe... doggo -b example.com? ("b" for both 😆)
  3. Instead of a flag, maybe an environment variable? DOGGO_DEFAULT_BOTH?

I might be missing something, but that's my perspective.

@mr-karan
Copy link
Owner

mr-karan commented Jul 2, 2024

Noted. 2 or 3 should be possible. Not willing to change default behaviour just after a major release. 😅

@mr-karan mr-karan added enhancement New feature or request good first issue Good for newcomers labels Jul 2, 2024
@daenney
Copy link

daenney commented Jul 2, 2024

systemd's resolvectl will query for both if a type is not specified:

$ resolvectl query google.com

google.com: 2a00:1450:400f:800::200e
            142.250.74.14

nslookup shares that behaviour:

$ nslookup google.com                                                                  

Non-authoritative answer:
Name:	google.com
Address: 142.250.74.14
Name:	google.com
Address: 2a00:1450:400f:800::200e

Despite dig and nslookup typically being provided by the BIND package on Linux, dig goes A only by default whereas nslookup seem to lookup both.

@rohit1kumar
Copy link

Hi @mr-karan If anyone else is not working I would like to pick it up.

@mr-karan
Copy link
Owner

mr-karan commented Jul 4, 2024

Hey. I was re-thinking about this, and adding a vague flag like --both (esp when there are so many record types) is not clear. Additionally, I've also added --any flag which queries all common record types.

So, I think 1) changing the default to show both A and AAAA should be alright? Also, now that the resolver lookup is concurrent, this shouldn't affect the default query latency too much either.

So, I am okay to change the default query type from just A to A and AAAA both, aligning with nslookup / resolvectl.

@rohit1kumar You're free to pick this up, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants