Code Monkey home page Code Monkey logo

dnsguide's Issues

Thanks a lot!

Thanks a lot, with the help of you project I've been able (after some trial & error) to write my own DNS server implementation - altough I've decided to do it in C# (because that's what I'm learning right now) and not in Rust (also, copy-paste Rust code seemed too easy).
You can check it out at https://github.com/delneg/dns_server_csharp
There are also branches for each chapter, if you're interested

Jump query issue

if (len & 0xC0) == 0xC0 {
                // Update the buffer position to a point past the current
                // label. We don't need to touch it any further.
                if !jumped {
                    try!(self.seek(pos+2));
                }

and

"" I mentioned earlier that each label is preceeded by a single byte length. The additional thing we need to consider is that if the two Most Significant Bits of the length is set, we can instead expect the length byte to be followed by a second byte. These two bytes taken together, and removing the two MSB's, indicate the jump position. In the example above, we've got 0xC00C. The bit pattern of the the two high bits expressed as hex is 0xC000 (in binary 11000000 00000000), so we can find the jump position by xoring our two bytes with this mask to unset them: 0xC00C ^ 0xC000 = 12. Thus we should jump to byte 12 of the packet and read from there. Recalling that the length the DNS header happens to be 12 bytes, we realize that it's instructing us to start reading from where the question part of the packet begins, which makes sense since the question starts with the query domain which in this case is "google.com". ""

Shoudnt we jump by the number indicated after the set flag? Why are we jumping from pos to pos+2 ?

help! multithreaded server

I wanted to turn your server to a multithreaded one and I receive this error
An error occurred: Either the application has not called WSAStartup, or WSAStartup failed. (os error 10093) handle An error occurred: Either the application has not called WSAStartup, or WSAStartup failed.

I know this is not an issue with your code, help would be much appreciated

DNS compression when writing labels

Hello. I am currently following your tutorial (great tutorial by the way), and am currently implementing the write methods for the stub resolver section. However, there is something that I don't quite understand: In chapter 1, the read_qname function implemented this label compression idea by jumping to and reusing old labels. However, in chapter two, the write_qname function doesn't implement the same idea. Did you just chose not to implement it, or is there something I am missing?

Thanks beforehand!

Multiple Borrowing Error!

In read_u16 and read_u32 function, multiple borrowing error is occuring. How did you compile your code?

License

Forgive me if I misread, but as it is now this project doesn't seem to have a license associated with it. What do you find acceptable?

Caching Dns guide?

I saw in your Hermes project you have caching. I have been using your dnsguide in implementing my own DNS server in python. Are you considering adding more parts to your guide such as how you dealt with caching?

[bug] `netcat` usage may be inproper for GNU's `netcat` in chaper 1.

I'm following your guide on my way to implementing my rust DNS server, but serval trials with your script on catching DNS querying packets lasted an empty query-packet.txt.

nc -u -l 1053 google.com

I'm using Arch Linux and my netcat version is GNU netcat 0.7.1. The proper way to catch the packet shall be as the following script, instead.

# use `-p` option explicitly
nc -u -l -p 1053 google.com

You might be using other versions of netcat, or the (GNU version) netcat itself had an update on its CLI. After all the script does not work on my environment, please take a look.

does not give proper IP address for non google domans

`; <<>> DiG 9.16.26 <<>> @127.0.0.1 -p 2053 www.twitch.tv
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50931
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 0

;; QUESTION SECTION:
;www.twitch.tv. IN A

;; ANSWER SECTION:
www.twitch.tv. 3600 IN CNAME twitch.map.fastly.net.

;; AUTHORITY SECTION:
twitch.tv. 172800 IN NS ns-1450.awsdns-53.org.
twitch.tv. 172800 IN NS ns-1778.awsdns-30.co.uk.
twitch.tv. 172800 IN NS ns-219.awsdns-27.com.
twitch.tv. 172800 IN NS ns-664.awsdns-19.net.

;; Query time: 842 msec
;; SERVER: 127.0.0.1#2053(127.0.0.1)
;; WHEN: Mon Mar 14 00:06:10 India Standard Time 2022
;; MSG SIZE rcvd: 255`

why is this happening?

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.