Linux: Set DNS Server with SED (resolv.conf)

Here is the a oneliner which sets the DNS Server to the Google DNS Server by replace the „nameserver <CURRENTNAMESERVER>“ with „nameserver 8.8.8.8“ in the /etc/resolv.conf File

sed -i 's/nameserver .*/nameserver 8.8.8.8/g' /etc/resolv.conf

Perhaps it is useful for anyone.. 🙂

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert