CLI Commands & Oneliners
CLI Commands & Oneliners
Samling af praktiske terminal-kommandoer og oneliners lige til at kopiere.
Flush DNS Cache
macOS
Ryd lokal DNS-cache og genindlæs mDNSResponder:
BASH
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Windows
Kør i Command Prompt (cmd) eller PowerShell:
POWERSHELL
ipconfig /flushdns
Linux (afhængigt af distribution og DNS-service)
#### 1. Ubuntu / Debian (systemd-resolved)
Klassisk kommando:
BASH
sudo systemd-resolve --flush-caches
Nyere Ubuntu (22.04 / 24.04 / 26.04 med resolvectl):
BASH
sudo resolvectl flush-caches
#### 2. NSCD (Name Service Cache Daemon)
BASH
sudo /etc/init.d/nscd restart
#### 3. Dnsmasq
BASH
sudo /etc/init.d/dnsmasq restart
#### 4. BIND (named)
BASH
sudo /etc/init.d/named restart