Networking

Switching

check host order on

Routing

What is routing?

The process to find the for data to travel from 1 device to another.

Commands

# show routing table
route
ip route

# add entries into routing table
ip route add 192.168.1.0/24 via 192.168.2.1

# assign new ip address
sudo ip addr add 172.16.238.15/24 dev eth0

Default gateway

DNS configuration

Domain names

for example: www.google.com

Record types

TypeexplainIP (ex)

A

IPv4

192.168.1.1

AAAA

IPv6

2001:0db8:85a3:0000:0000:8a2e:0370:7334

CNAME

name to name mapping

eat.web-server, hungry.web-server

Commands

# query the DNS server
nslookup www.google.com

# get details of DNS name resolution
dig www.google.com

DNS configuration file

resolv.conf contains nameserver, the resolver will ask the nameserver for ip address.

/etc/resolv.conf

Commands

# check host list
cat /etc/resolv.conf

# add server to host file
cat >> /etc/hosts
192.168.1.1

Last updated