pingr icon indicating copy to clipboard operation
pingr copied to clipboard

Add support for parsing SRV records to nsl()

Open davidski opened this issue 4 years ago • 3 comments

Could support for parsing SRV records be added to nsl()?

I've been looking for a self-contained way to query SRV records, ultimately to enable shiny apps to find plumber API endpoints in a micro-services environment. pingr::nsl() is allllmost there. 😄

davidski avatar Jul 07 '20 02:07 davidski

What happens with SRV records currently?

gaborcsardi avatar Jul 07 '20 07:07 gaborcsardi

Hi!

As a non-supported DNS type, a raw vector is returned. Getting parsing into nsl() to enable easy extraction of the values of the record (target, port, and weight) would be awesome!

pingr::nsl(domain = "_http._tcp.mxtoolbox.com", type = 33L)
#> $answer
#>                       name class type  ttl
#> 1 _http._tcp.mxtoolbox.com     1   33 3600
#>                                                                                 data
#> 1 00, 0a, 00, 64, 00, 50, 09, 6d, 78, 74, 6f, 6f, 6c, 62, 6f, 78, 03, 63, 6f, 6d, 00
#> 
#> $flags
#>    aa    tc    rd    ra    ad    cd 
#> FALSE FALSE  TRUE  TRUE FALSE FALSE

Created on 2020-07-07 by the reprex package (v0.3.0)

davidski avatar Jul 07 '20 13:07 davidski

Right. I think we could have a parse_record() function. Or just start returning a proper list in $data, I doubt that many people currently rely on $data being a raw vector for type 33.

I am not very familiar these records, unfortunately, so help is welcome.

gaborcsardi avatar Jul 07 '20 19:07 gaborcsardi