phuslu / fastdns Goto Github PK
View Code? Open in Web Editor NEWFast DNS package for Go. Tuned for high performance. Zero memory allocations in almost paths. Up to 1M QPS on a single host.
License: MIT License
Fast DNS package for Go. Tuned for high performance. Zero memory allocations in almost paths. Up to 1M QPS on a single host.
License: MIT License
Hey,
in short term, im trying to use fastdig as an alternative for "dig". When im using "dig" everything works expected, but on fastdig the result is missing. Example:
; <<>> DiG 9.16.44-Debian <<>> @1.1.1.1 t3n.de TXT
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21655
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;t3n.de. IN TXT
;; ANSWER SECTION:
t3n.de. 20995 IN TXT "nJg0mOQ"
t3n.de. 20995 IN TXT "v3nk3wg16gqgph0x4q2g45kj1j6g0b9f"
t3n.de. 20995 IN TXT "loaderio=6cead61edf5d0ea1a2297c1e7a409e87"
t3n.de. 20995 IN TXT "google-site-verification=ojkBs6li65pAGMwyGZl3Q1O0Q4DDMn8CPebe5bgeGNo"
t3n.de. 20995 IN TXT "hns-claim:aakgrn5php6ppybp6bjmlczduk3gplljzyfp5kfgaeaaaaaaaaaklzaororjdpl6qzexi75h7ofhv447lownw5btzuxvs4ibaaaabnvuzysq"
t3n.de. 20995 IN TXT "v=spf1 include:servers.mcsv.net include:spf.mailjet.com mx include:helpscoutemail.com include:_spf.intan.net include:_spf.google.com include:eu.zcsend.net ~all"
;; Query time: 4 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Wed Mar 20 15:40:46 EDT 2024
;; MSG SIZE rcvd: 538
; <<>> DiG 0.0.1-fastdns-go1.21.5 <<>> t3n.de
;; global options: +cmd +noedns
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65246
;; flags: qr tc rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;t3n.de. IN TXT
;; AUTHORITY SECTION:
;; Query time: 7 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Wed Mar 20 15:40:36 EDT 2024
;; MSG SIZE rcvd: 24
Im using the master, maybe its a bug?
//edit:
i downgraded till v0.6.0. looks like a basic problem
panic: runtime error: index out of range [201] with length 9
goroutine 852 [running]:
github.com/phuslu/fastdns.(*Message).DecodeName(0xc00f291260, {0x0?, 0x0, 0x7a4a58?}, {0xc0037f352b, 0x9, 0x5cc46c?})
/root/go/pkg/mod/github.com/phuslu/[email protected]/message.go:201 +0x431
req, resp := fastdns.AcquireMessage(), fastdns.AcquireMessage()
defer fastdns.ReleaseMessage(req)
defer fastdns.ReleaseMessage(resp)
req.SetRequestQustion(domain, fastdns.TypeMX, fastdns.ClassINET)
err := fastdnsClient.Exchange(req, resp)
if err != nil {
log.Println(err)
return "", "", err
}
var hosts []string
_ = resp.Walk(func(name []byte, typ fastdns.Type, class fastdns.Class, ttl uint32, data []byte) bool {
if typ == fastdns.TypeMX {
hosts = append(hosts, string(resp.DecodeName(nil, data[2:])))
}
return true
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.