mirror of
https://github.com/EmilHernvall/dnsguide.git
synced 2024-12-22 15:24:15 +07:00
commit
2d3db41e33
@ -420,7 +420,7 @@ impl BytePacketBuffer {
|
||||
// track whether or not we've jumped
|
||||
let mut jumped = false;
|
||||
|
||||
// Our delimeter which we append for each label. Since we don't want a dot at the
|
||||
// Our delimiter which we append for each label. Since we don't want a dot at the
|
||||
// beginning of the domain name we'll leave it empty for now and set it to "." at
|
||||
// the end of the first iteration.
|
||||
let mut delim = "";
|
||||
|
@ -1,7 +1,7 @@
|
||||
2 - Building a stub resolver
|
||||
============================
|
||||
|
||||
While it's slightly satisfying to know that we're able to succesfully parse DNS
|
||||
While it's slightly satisfying to know that we're able to successfully parse DNS
|
||||
packets, it's not much use to just read them off disk. As our next step, we'll
|
||||
use it to build a `stub resolver`, which is a DNS client that doesn't feature
|
||||
any built-in support for recursive lookup and that will only work with a DNS
|
||||
|
@ -197,7 +197,7 @@ fn main() {
|
||||
// the raw bytes are simply returned, and if not it'll abort by restarting the
|
||||
// loop and waiting for the next request. The `recv_from` function will write the
|
||||
// data into the provided buffer, and return the length of the data read as well
|
||||
// as the source adress. We're not interested in the length, but we need to keep
|
||||
// as the source address. We're not interested in the length, but we need to keep
|
||||
// track of the source in order to send our reply later on.
|
||||
|
||||
// Next, `DnsPacket::from_buffer` is used to parse the raw bytes into
|
||||
|
@ -15,7 +15,7 @@ logical servers, but in reality many more. You can read more about it
|
||||
13 servers before hand. A file containing all of them, in bind format, is
|
||||
available and called [named.root](https://www.internic.net/domain/named.root).
|
||||
These servers all contain the same information, and to get started we can pick
|
||||
one of them at random. Looking at `named.root` we see that the IP-adress of
|
||||
one of them at random. Looking at `named.root` we see that the IP-address of
|
||||
*a.root-servers.net* is 198.41.0.4, so we'll go ahead and use that to perform
|
||||
our initial query for *www.google.com*.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user