- # October 22 - DNS Continued (and Ports)
- ## Overview
- - [Local Files](#local-files)
- - `/etc/services`
- - `/etc/resolv.conf`
- - `/etc/nsswitch.conf`
- - `/etc/hosts`
- - BIND, Domain
- - DNS Records
- - Zone Files
- ## Unix filesystem standards
- - bin - binary executables
- - sbin - system administator's binary executables
- - etc - configuration files
- - tmp - temporary files (wiped on boot up)
- - var - writable, non-sharable files
- ## Local Files
- - `/etc/resolve.conf` lists the current dns server for resolving dns requests
- - `/etc/hosts` is a local list of dns entries
- - `/etc/nsswitch.conf` is the config of the GNU Name Service Switch
- # /etc/hosts can be used to block websites:
- $ echo '0.0.0.0 example.com' >> /etc/hosts
- ## Ports
- A socket contains a source and destination ip and port, it lists every
- Ports 0-1024 are "privilege ports" and require root to use.
- Port 42 used to be used for WINS, Windows Internet Naming Service, before it was
- replaced with regular DNS.
- Port 53 is for DNS.
- HTTP is on port 80 for the server and for any port over 1024 for the client.