Created
May 8, 2022 13:36
-
-
Save mshafiee/0b3e93c34c154dad0cab5be4724cb72c to your computer and use it in GitHub Desktop.
Ubuntu 20.04.4 - Scripting Netplan for custom DNS address
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo snap install yq | |
sudo cp /etc/netplan/00-installer-config.yaml /etc/netplan/00-installer-config.yaml.bk_`date +%Y%m%d%H%M` | |
cat /etc/netplan/00-installer-config.yaml | yq -e '.network.ethernets.ens160.nameservers.addresses[0]="192.168.10.11" | .network.ethernets.ens160.nameservers.addresses[1]="192.168.10.12"' | sudo tee /etc/netplan/00-installer-config.yaml | |
sudo netplan apply |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment