Created
October 3, 2017 18:26
-
-
Save m13253/f354f601bb741d1c0ef903ee2104e936 to your computer and use it in GitHub Desktop.
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/miekg/dns" | |
) | |
func main() { | |
err := dns.ListenAndServe(":5533", "udp", dns.HandlerFunc(handler)) | |
if err != nil { | |
log.Fatalln(err) | |
} | |
} | |
func handler(w dns.ResponseWriter, r *dns.Msg) { | |
w.WriteMsg(new(dns.Msg).SetReply(r)) | |
log.Println(r.String()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment