Network Addresses, DNS and Routing
Overview
Network communication requires a local address, a route to the destination and often a DNS lookup. An IP address identifies an interface. A gateway is the router used to reach outside networks. DNS translates names to addresses.
Detailed Notes
Inspect interfaces
ip address
ip route
hostname
ip addressprints interfaces and assigned IPs.ip routeprints routing tables.hostnameprints the machine name.
A default route can look like:
default via 192.168.1.1 dev eth0
The packet leaves interface eth0 through gateway 192.168.1.1 when no more specific route matches.
DNS
getent hosts example.com
dig example.com
nslookup example.com
getent hosts asks the system resolver and shows resolved addresses. dig displays DNS response sections and is useful for detailed diagnosis.
Test reachability
ping -c 4 192.168.1.1
ping -c 4 example.com
Ping may be blocked by a firewall even if HTTPS or SSH works. It is evidence from the ICMP path, not proof that every protocol works.
Diagnose a connection
curl -v https://example.com
openssl s_client -connect example.com:443
curl -v shows DNS, connection, TLS and HTTP steps. openssl s_client opens a raw TLS connection and can expose certificate or handshake errors.
Common Interview Questions
Chapter quiz
Linux Fundamentals · 9 questions
1.What does `pwd` print?
2.Which command creates an empty file if it does not exist?
3.What does `..` represent?
4.What does mode 640 mean?
5.Which signal normally requests graceful process shutdown?
6.Which command exports a variable to child processes?
7.What does `grep` search?
8.What does a pipe send to the next command?
9.What does `ip route` show?
0 of 9 answered
Finished this lesson?
0 of 25 lessons done · 0% of the course

