Skip to content

Instantly share code, notes, and snippets.

@sajal
Created March 27, 2015 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sajal/2319444906bc0e828ad1 to your computer and use it in GitHub Desktop.
Save sajal/2319444906bc0e828ad1 to your computer and use it in GitHub Desktop.
Decode RIPE ATLAS DNS results.
package main
import (
"encoding/base64"
"fmt"
"github.com/miekg/dns"
)
func main() {
//Decode base64 to binary
data, _ := base64.StdEncoding.DecodeString("f2+AgAABAAEAAAAAA3d3dwRyaXBlA25ldAAAAQABwAwAAQABAAA3+gAEwQAGiw==")
//new dns message
m := &dns.Msg{}
//Load binary into message
m.Unpack(data)
fmt.Println(m)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment