CS代考 • nslookup

• nslookup
• dns.cpp – our own C/C++ code
• WireShark
• ipconfig

Copyright By PowCoder代写 加微信 powcoder

Useful commands
• ipconfig /all
• ipconfig /displaydns
• ipconfig /flushdns
Display DNS server address, adapter type, etc.
Display cached DNS resource records
clear DNS cache

Useful commands
Nslookup – a network tool for querying the Domain Name System to obtain the mapping between host/domain name and IP address, or other
DNS records.
The host can be either a fully qualified name, (terminated with a dot), or a relative name, in which case the current domain is appended to it.
nslookup [–option1 –option2] host [dns_server]
Optional. If not set, by default, the local DNS is queried
nslookup -debug -type=MX ibm.com 8.8.8.8
Google’s public DNS server

Request for a recursive/non-recursive query Request for an IPv4 or IPv6 mapping of a hostname
C:\>nslookup -recurse –type=A www.google.co.nz 8.8.8.8
Non-authoritative answer: Name: www.google.co.nz Address: 172.217.167.67
Request for an IPv4 mapping
C:\>nslookup -norecurse –type=AAAA www.google.co.nz 8.8.8.8
Non-authoritative answer:
Name: www.google.co.nz
Address: 2404:6800:4006:804::2003
Request for an IPv6 mapping
Request for recursive query from DNS server

Find the canonical name for an alias domain name.
C:\>nslookup -query=cname www.ibm.com 8.8.8.8 Server: dns.google
Address: 8.8.8.8
Canonical name
Non-authoritative answer:
www.ibm.com canonical name = www.ibm.com.cs186.net
Parameter, indicating that we want the canonical name for www.ibm.com

nslookup: relative host name
Relative host name
If the host is not terminated with a dot (not a fully qualified name), the computer’s domain (primary DNS suffix) is automatically appended to it.
Example: If your computer’s domain is massey.ac.nz, and you pass a hostname without a dot at the end of its name, then that hostname will be treated as a relative host name. In turn it will be appended with your computer’s domain name, resulting to multiple queries being sent to the name server.
 C:\>nslookup –debug www.ibm.com www.ibm.com.massey.ac.nz
Different domain names will be used, resulting to multiple queries
www.ibm.com.ac.nz www.ibm.com
All these details could be observed when using the debug mode of nslookup.

nslookup: relative host name
In this demonstration, the host name used is relative name, in which case the
current domain is appended to it.
e.g. C:\>nslookup -debug www.ibm.com 8.8.8.8
Computer’s domain:
Relative name
massey.ac.nz
It can be observed that multiple queries were sent containing the appended domain name.
ibm.com.massey.ac.nz ibm.com.ac.nz ibm.com

nslookup: absolute host name
Solution: to avoid unnecessary addition of suffixes to the hostname, we can simply add a single dot (.) at the end of the host name we want to resolve.
C:\>nslookup -debug www.ibm.com. 8.8.8.8
add a single dot (.)

C:\>nslookup -query=A google.co.nz Server: dns.google
Address: 8.8.8.8
Non-authoritative answer: Name: google.co.nz Address: 142.250.76.99
Cached information is typically discarded after about 2 days.
2: Application Layer 9

What are the authoritative name servers for the domain google.com? C:\>nslookup -query=NS google.com
 Server: vodafone.station  Address: 192.168.1.1
 Non-authoritative answer:
Multiple nameservers
 google.com  google.com  google.com  google.com
nameserver = ns1.google.com nameserver = ns2.google.com nameserver = ns4.google.com nameserver = ns3.google.com
IP addresses of nameservers
 ns1.google.com internet address = 216.239.32.10  ns2.google.com internet address = 216.239.34.10  ns3.google.com internet address = 216.239.36.10  ns4.google.com internet address = 216.239.38.10
2: Application Layer 10

What is the canonical name for mail exchanger of gmail.com?
To Query MX (Mail Exchange) record.
C:\Users\nhreyes>nslookup -query=MX gmail.com. 8.8.8.8 Server: dns.google
Address: 8.8.8.8
Non-authoritative answer:
gmail.com gmail.com gmail.com gmail.com gmail.com
MX preference = 30, mail exchanger = alt3.gmail-smtp-in.l.google.com MX preference = 5, mail exchanger = gmail-smtp-in.l.google.com
MX preference = 20, mail exchanger = alt2.gmail-smtp-in.l.google.com MX preference = 10, mail exchanger = alt1.gmail-smtp-in.l.google.com MX preference = 40, mail exchanger = alt4.gmail-smtp-in.l.google.com
2: Application Layer 11

nslookup -query=mx gmail.com
We can see here that successive DNS translation requests
returned a different ordering of the replicated servers.
C:\Users\nhreyes>nslookup -query=mx gmail.com Server: alb-net1.massey.ac.nz
Address: 130.123.104.53
C:\Users\nhreyes>nslookup -query=mx gmail.com Server: alb-net1.massey.ac.nz
Address: 130.123.104.53
Non-authoritative answer:
Non-authoritative answer:
gmail.com gmail.com gmail.com gmail.com gmail.com
MX preference = 30, mail exchanger = alt3.gmail-smtp-in.l.google.com MX preference = 5, mail exchanger = gmail-smtp-in.l.google.com
MX preference = 40, mail exchanger = alt4.gmail-smtp-in.l.google.com MX preference = 20, mail exchanger = alt2.gmail-smtp-in.l.google.com MX preference = 10, mail exchanger = alt1.gmail-smtp-in.l.google.com
gmail.com gmail.com gmail.com gmail.com gmail.com
MX preference = 5, mail exchanger = gmail-smtp-in.l.google.com
MX preference = 40, mail exchanger = alt4.gmail-smtp-in.l.google.com MX preference = 20, mail exchanger = alt2.gmail-smtp-in.l.google.com MX preference = 10, mail exchanger = alt1.gmail-smtp-in.l.google.com MX preference = 30, mail exchanger = alt3.gmail-smtp-in.l.google.com
nameserver = ns4.google.com nameserver = ns2.google.com nameserver = ns3.google.com nameserver = ns1.google.com
ns2.google.com internet address = 216.239.34.10 ns1.google.com internet address = 216.239.32.10 ns3.google.com internet address = 216.239.36.10 ns4.google.com internet address = 216.239.38.10
ns2.google.com internet address = 216.239.34.10 ns1.google.com internet address = 216.239.32.10 ns3.google.com internet address = 216.239.36.10 ns4.google.com internet address = 216.239.38.10
nameserver = ns2.google.com nameserver = ns4.google.com nameserver = ns3.google.com nameserver = ns1.google.com
2: Application Layer 12

List the details of the Start of Authority for a given host/domain name. This includes the authoritative nameserver and email of the administrator.
C:\>nslookup -type=SOA gmail.com. 8.8.8.8 Server: dns.google
Address: 8.8.8.8
Non-authoritative answer: gmail.com
primary name server = ns1.google.com responsible mail addr = dns-admin.google.com serial = 434128744
refresh = 900 (15 mins)
retry = 900 (15 mins)
expire = 1800 (30 mins)
default TTL = 60 (1 min)

Perform a reverse lookup. It resolves an IP address to a domain or hostname.
C:\>nslookup 216.239.32.10 8.8.8.8 Server: dns.google
Address: 8.8.8.8
Name: ns1.google.com Address: 216.239.32.10

Nslookup (interactive mode)
Cloudflare is a public DNS server with IP address of 1.1.1.1
Specify a new DNS server to send a query to
Request for a canonical name
Name resolution succeeds!

Public DNS Servers (free to use!)
The Google Public DNS IP addresses (IPv4) are as follows:  8.8.8.8
Cloudflare Public DNS:  1.1.1.1
The Google Public DNS IPv6 addresses are as follows:  2001:4860:4860::8888
 2001:4860:4860::8844
You can use any of these addresses as your primary or secondary DNS server.
https://developers.google.com/speed/public-dns/docs/using

References
1. Kurose book
2. https://www.cloudflare.com/learning/dns/
3. https://developers.google.com/speed/public-dns/docs/using
4. https://www.thegeekstuff.com/2012/07/nslookup-examples/
5. https://www.pcwdld.com/nslookup-dns-records#wbounce- modal
6. http://osr600doc.sco.com/en/NET_tcp/dnsD.nsopts.html

2: Application Layer 18

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com