Configuring DNS on Linux VMs
DNS translates domain names into IP addresses. Linux VMs need working DNS nameserver configuration to resolve domains and communicate with network services.
This guide covers Ubuntu, CentOS, RHEL, and Oracle Linux.
Prerequisites
Before configuring DNS nameservers, make sure you have:
- Administrative privileges through
sudoor root access. - DNS nameserver IP addresses.
Use these SITE Cloud DNS nameservers:
100.64.3.140
100.80.0.175
Configure Nameservers
- Open a terminal.
- Edit
/etc/netplan/99-netcfg-vmware.yamlusing a text editor such asnanoorvim. - Add the nameservers under
addresses:
nameservers:
addresses: [100.64.3.140, 100.80.0.175]
- Save the file.
- Apply the configuration:
sudo netplan apply
Review before applying
Review the Netplan file before applying changes. A syntax error may disrupt network connectivity.
- Open a terminal.
- Edit
/etc/resolv.confusing your preferred text editor. - Add the DNS nameservers at the top of the file:
nameserver 100.64.3.140
nameserver 100.80.0.175
- Save the file.
Verifying DNS Resolution
[ADD CONTENT: No existing content in current documentation.]
Safety and Security
Follow these safety practices:
- Use trusted DNS servers, such as SITE Cloud DNS.
- Avoid DNS servers from untrusted sources.
- Double-check configuration before applying changes.
- Keep the system and software updated.
- Maintain firewall rules that restrict DNS access to trusted networks.
- Consider DNSSEC to validate DNS responses.