mwarning / simpledns Goto Github PK
View Code? Open in Web Editor NEWA very simple and small DNS Server to help understanding the protocol basics.
License: Creative Commons Zero v1.0 Universal
A very simple and small DNS Server to help understanding the protocol basics.
License: Creative Commons Zero v1.0 Universal
Could you implement TXT ?
I'm learning DNS program and reading your code.
I add code to support TXT, but the answer can not be parsed successfully by dig.
As the title say.
ttl is wrong.
Hi mwarning,
It seems to me that the const RA_MASK's value defined here (
Line 38 in f54b97f
Would you please have time to look at my code.
When I dig @127.0.0.1 -p 9000 foo.bar.com
, only an answer returned.
At the same time, line 233 print pointer not nil, however line 424 print poninter as (nil).
https://github.com/glennWang/SimpleDNS/blob/master/main.c#L233
Would you have time to have a look at my problem?
Basied on your demo program, I get the result:
My result:
dig cname.ihih.ml
; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.1 <<>> cname.ihih.ml
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58442
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;cname.ihih.ml. IN A
;; Query time: 110 msec
;; SERVER: 100.100.2.138#53(100.100.2.138)
;; WHEN: 一 3月 02 18:54:46 CST 2020
;; MSG SIZE rcvd: 42
-----------------------------------------------------
dig cname.ihih.ml cname
; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.1 <<>> cname.ihih.ml cname
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 9014
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;cname.ihih.ml. IN CNAME
;; ANSWER SECTION:
cname.ihih.ml. 19 IN CNAME www.infoch.cn.
;; Query time: 4 msec
;; SERVER: 100.100.2.138#53(100.100.2.138)
;; WHEN: 一 3月 02 18:55:02 CST 2020
;; MSG SIZE rcvd: 69
---------------------------------------------------------------
dig www.infoch.cn
; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.1 <<>> www.infoch.cn
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28656
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;www.infoch.cn. IN A
;; ANSWER SECTION:
www.infoch.cn. 270 IN A 58.51.101.160
;; Query time: 0 msec
;; SERVER: 100.100.2.138#53(100.100.2.138)
;; WHEN: 一 3月 02 18:55:14 CST 2020
;; MSG SIZE rcvd: 58
The expected result looks like the following:
dig www.baidu.com
; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7_5.1 <<>> www.baidu.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24746
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.baidu.com. IN A
;; ANSWER SECTION:
www.baidu.com. 1195 IN CNAME www.a.shifen.com.
www.a.shifen.com. 123 IN A 220.181.38.149
www.a.shifen.com. 123 IN A 220.181.38.150
;; Query time: 0 msec
;; SERVER: 100.100.2.138#53(100.100.2.138)
;; WHEN: 一 3月 02 18:46:00 CST 2020
;; MSG SIZE rcvd: 90
There is more than one name server record generally.
For example:
ns1.foo.bar.
ns2.foo.bar.
How the name_server_record struct support this condition ?
Hi mwarning,
I am wondering why the follow section would work
Let's say the domain name in query is foo-bar.example.com, its encoded version is 7foo-bar6example3com0. Since the ASCII code of -
is 45, which is not greater than 63, won't it be decoded to foo.bar.example.com by your current implementation?
( I do notice that you stated "No full validation is done!", but I am not sure if the issue I just point out is also expected)
Alex
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.