3 Minutes Walk-through DNS

Command lines in this article are based on MacOS/Linux though terms should work across other platforms as well. // Hit ifconfig in terminal, you probably see @zoe ~% ifconfig lo0 : ....127.0.01 gif0: en3: bridge0: ap1: utun0: .... Question1: What do they mean in similar structs? Headers like lo0 denote the name of Network Interfaces(Iface), aka. en — Ethernet, lo — Loop. en0 — this interface enable you to read this article; lo0 — internal address which always therewithout wifi connection awdl0 /llw0— airdrop anpi / en3 / en4 — USB-C / lightening bridge0 — literally a bridge to make communications ap1 — hotspot Question2: Why there are so many interfaces? It mainly depends on how you digging around. Bluetooth, Wi-Fi, Airdrop, Docker, VPN, etc are included as long as you turn on the specific over the air connections. Time to into the internet interface Destination Gateway Genmask Iface 192.168.1.0 0.0.0.0 255.255.255.0 eth0 0.0.0.0 192.168.1.1 0.0.0.0 eth0 Destination decides where the data will be passed to. For example, 8.8.8.8(Google.com). But before you are going to visit Google, the computer needs to connect Internet. The router gives you a address like 192.168.1.x (IP), used to visit other ip address. Genmask is like if-else condition to check whether the destination is needed a delivery man or not (beyond reachable range, aka local network). Gateway is like a postman, assisting you sending the parcel to address away from here if it is represented other than 0.0.0.0 0.0.0.0 can match to any address(0~255.0~255.0~255.0~255). For example, if you want to visit Google(8.8.8.8, the destination), Genmask (0.0.0.0) confim it is a match then the Gateway(192.168.1.1) directs you to the Google website. Take-away: If (Destination-Genmask not match) → {Gateway deliver the parcel}; else {Solved in Local Nerwork}.