Created
April 25, 2017 20:55
-
-
Save jelu/ad8fd5d19bc43451e7f4fa3ae30ca9f4 to your computer and use it in GitHub Desktop.
Want to see what all RIPE Atlas probes are querying right now?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"github.com/DNS-OARC/ripeatlas" | |
"github.com/DNS-OARC/ripeatlas/measurement/dns" | |
) | |
func print(r *dns.Result) { | |
if r != nil { | |
m, _ := r.UnpackAbuf() | |
if m != nil && len(m.Question) > 0 { | |
log.Println(m.Question[0].Name) | |
} | |
} | |
} | |
func main() { | |
a := ripeatlas.Atlaser(ripeatlas.NewStream()) | |
c, _ := a.MeasurementResults(ripeatlas.Params{"type": "dns"}) | |
for r := range c { | |
print(r.DnsResult()) | |
for _, s := range r.DnsResultsets() { | |
print(s.Result()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment