Giter Club home page Giter Club logo

simpledns's People

Contributors

chmorgan avatar clementperon avatar glennwang avatar mwarning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simpledns's Issues

support TXT

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.

const RA_MASK seems incorrect

Hi mwarning,

It seems to me that the const RA_MASK's value defined here (

static const uint32_t RA_MASK = 0x8000;
) is incorrect. According to my understanding of the DNS protocol, the constant should be 0b0000000010000000 (or 0x80) instead of 0x8000 (or 0b1000000000000000).

How can I trace the CNAME record until the A record is obtained ?

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

Multi name server

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 ?

On the implementation of decode_domain_name

Hi mwarning,

I am wondering why the follow section would work

(https://github.com/mwarning/SimpleDNS/blob/5bdd512af5fa750fd55c28c7c04d74c40ae0ef2d/main.c#L339-L341)

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.