The server houses a DNS recursive resolver and it is compatible with dig.
- A
- AAAA
- NS
- MX
- CNAME
- You will need to have Rust installed. Download rustup.
- clone the repo.
- run
cargo build
&&cargo run
- run
dig @127.0.0.1 -p 2053 google.com
(if your are using powershelldig "@127.0.0.1" -p 2053 google.com
)
-> dig "@127.0.0.1" -p 2053 twitch.tv
; <<>> DiG 9.16.26 <<>> @127.0.0.1 -p 2053 twitch.tv
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53972
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 4, ADDITIONAL: 4
;; QUESTION SECTION:
;twitch.tv. IN A
;; ANSWER SECTION:
twitch.tv. 3600 IN A 151.101.130.167
twitch.tv. 3600 IN A 151.101.66.167
twitch.tv. 3600 IN A 151.101.2.167
twitch.tv. 3600 IN A 151.101.194.167
;; 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: 500 msec
;; SERVER: 127.0.0.1#2053(127.0.0.1)
;; WHEN: Mon May 16 15:46:05 India Standard Time 2022
;; MSG SIZE rcvd: 303
Finished dev [unoptimized + debuginfo] target(s) in 0.05s
Running `target\debug\dns_server.exe`
Query = DnsQuestion { name: "twitch.tv", qtype: A }
Looking up A twitch.tv with ns 198.41.0.4
Looking up A twitch.tv with ns 192.42.173.30
Looking up A ns-219.awsdns-27.com with ns 198.41.0.4
Looking up A ns-219.awsdns-27.com with ns 192.5.6.30
Looking up A ns-219.awsdns-27.com with ns 205.251.192.28
Looking up A twitch.tv with ns 205.251.192.219
Answer: A { domain: "twitch.tv", addr: 151.101.130.167, ttl: 3600 }
Answer: A { domain: "twitch.tv", addr: 151.101.66.167, ttl: 3600 }
Answer: A { domain: "twitch.tv", addr: 151.101.2.167, ttl: 3600 }
Answer: A { domain: "twitch.tv", addr: 151.101.194.167, ttl: 3600 }
Authorities : NS { domain: "twitch.tv", host: "ns-1450.awsdns-53.org", ttl: 172800 }
Authorities : NS { domain: "twitch.tv", host: "ns-1778.awsdns-30.co.uk", ttl: 172800 }
Authorities : NS { domain: "twitch.tv", host: "ns-219.awsdns-27.com", ttl: 172800 }
Authorities : NS { domain: "twitch.tv", host: "ns-664.awsdns-19.net", ttl: 172800 }
Resource: UNKNOWN { domain: "", qtype: 0, data_len: 0, ttl: 0 }
Resource: UNKNOWN { domain: "", qtype: 0, data_len: 0, ttl: 0 }
Resource: UNKNOWN { domain: "", qtype: 0, data_len: 0, ttl: 0 }
Resource: UNKNOWN { domain: "", qtype: 0, data_len: 0, ttl: 0 }
Skipping record: UNKNOWN { domain: "", qtype: 0, data_len: 0, ttl: 0 }
Skipping record: UNKNOWN { domain: "", qtype: 0, data_len: 0, ttl: 0 }
Skipping record: UNKNOWN { domain: "", qtype: 0, data_len: 0, ttl: 0 }
Skipping record: UNKNOWN { domain: "", qtype: 0, data_len: 0, ttl: 0 }
run cargo doc --open