Saturday, April 27, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1639  / 2 Years ago, mon, may 16, 2022, 5:12:54

I am new in ubuntu.


When installing Ubuntu, I set the network settings manually and manually set up the IP and DNS server in installation wizard , but now I after installation complete can not change the settings (especially DNS) in installed ubuntu. In other words, I do not know where these settings are stored. I tried different solutions but none of them worked. Can you guide me?
Thanks


OS : ubuntu server 18.04 

More From » command-line

 Answers
5

In Ubuntu 18.04 server and all later versions of Server that you install from the ISO manually yourself, all configurations for networking during installation are stored in Netplan YAML files, in /etc/netplan/.


Post installation, if you want to configure your networking differently, you will edit the YAML file that was created in /etc/netplan/ with your favorite editor (such as nano or vim) as superuser (prepend sudo to the command to edit). It might even save it as '50-cloud-init.yaml' but that's fine, you can edit that file even if it says 'cloud-init' generates it - it shouldn't regenerate it post install.


Netplan configuration files have this type of YAML structure if you set a static IP and DNS (and didn't use DHCP) - this is a configuration from an 18.04 VM running on my network which has a special DNS server as well as Google DNS for its specialized configuration as an example of a 'complete' NetPlan configuration:


network:
version: 2
renderer: networkd
ethernets:
enp8s0:
dhcp4: false
addresses:
- 10.10.1.0/16
gateway4: 10.10.0.1
nameservers:
addresses:
- 10.10.1.2
- 8.8.8.8
- 8.8.4.4

If you edit the file, you should then run sudo netplan apply and make sure everything works fine. No reboot necessary. If the configurations don't work, revert whatever change you make, and run sudo netplan apply again.


[#1294] Tuesday, May 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
adedes

Total Points: 454
Total Questions: 114
Total Answers: 111

Location: Turks and Caicos Islands
Member since Fri, May 8, 2020
4 Years ago
;