When we enter hostname in browser address bar, after resolving hostname to ip, the browser also sends the hostname in http header to the resolved ip. This will enable using one ip to serve multiple websites.
# NOTE: use `dig githubutilities.github.io` to resolve hostname to ip(`103.245.222.133`)
curl -I 103.245.222.133
# vs
curl -I 103.245.222.133 --header "Host: githubutilities.github.io"
github.io pages is actually a
CNAME
togithub.map.fastly.net.
, which is used by github to route the traffics.
| NAME | TTL | CLASS | TYPE | IP |
TTL is use to cache the results.
check the serial number
which will be incremented on each update of SOA response.
dig google.com +nssearch | cut -d ' ' -f 4 | sort | uniq -c
Mail servers like AOL might use PTR records to verify incoming mail address identities.
# reverse dig ip
dig -x <ip>
> ```'google.com
ip redirecting is based on http headers(
Location: http://www.google.com/`)baidu.com
ip redirecting is based on http
using +trace
option in dig
-
A - IPv4 IP address
-
AAAA - IPv6 IP address
-
CNAME - Canonical name record (Alias)
-
NS - Name Servers
-
MX - Mail eXchanges
-
PTR - PoinTeR record. Pointer to a canonical name
-
SOA - Start Of Authority. Authoritative information about a DNS zone
-
TXT - text record
visit google domain for more infos.