Skip to content

[Feat] Support more ways of specifying a target nameserver, like doggo #85

@00dani

Description

@00dani

Classic dig as well as the doggo clone of dog both support specifying a conventional DNS nameserver (to be accessed over UDP) by simply providing its domain name, like this:

$ dig my.loopback.dev.domain.lo @localhost # same as @::1
$ dig TXT _dmarc.00dani.me @dns.quad9.net # same as @9.9.9.9
$ doggo TXT _dmarc.00dani.me @ns.00dani.me # ask the authoritative nameserver directly!

But currently dog_community will panic if you do this, as it attempts to parse the nameserver as a regular IP address rather than a domain name and fails:

$ doge TXT _dmarc.00dani.me @ns.00dani.me
thread 'main' panicked at doge_transport-0.2.6/src/udp.rs:46:52:
Failed to parse Ip addr: AddrParseError(Ip)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This syntax ought to work exactly like it does with dig and doggo.

doggo also supports DNS over TCP, DoT, and DoH through URL protocol syntax, like this:

$ doggo TXT _dmarc.00dani.me @tcp://dns.quad9.net
$ doggo TXT _dmarc.00dani.me @tls://dns.quad9.net
$ doggo TXT _dmarc.00dani.me @https://dns.quad9.net/dns-query

dog_community does of course support those protocols, but it always requires explicit flags to specify the desired transport:

$ doge --tcp TXT _dmarc.00dani.me @dns.quad9.net
$ doge --tls TXT _dmarc.00dani.me @dns.quad9.net
$ doge --https TXT _dmarc.00dani.me @https://dns.quad9.net/dns-query

Note that the DoH syntax actually requires both the --https flag and the https:// protocol in the nameserver to work properly, which feels needlessly redundant.

I suggest dog_community ought to be able to parse specifications like @dns.quad9.net while performing conventional DNS over UDP, as well as understanding syntax like @tls://dns.quad9.net and @https://dns.quad9.net/dns-query as requesting a switch to DoT or DoH respectively without requiring a separate flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions