Enabling Active Directory DNS Resolution on Ubuntu
Objective: Configure the Ubuntu VM to use the Active Directory Domain Controller (DC) as its primary DNS server for name resolution.
Technical Solution: Updating the Nameserver
To allow Ubuntu to "see" the AD environment, you must point its DNS configuration to the IP address of the Domain Controller.
1. Identify the DNS IP
On any of your Windows VMs already in the domain, find the DNS server IP (usually the IP of your Domain Controller).
2. Update the Configuration
In Linux, DNS resolution is primarily handled by the resolv.conf file. You need to add your AD DNS IP to this file.
File Path:
/etc/resolv.confAction: Add a
nameserverentry at the top of the file.
Example Entry
nameserver 192.168.1.10 # Replace with your AD DNS IP
search yourdomain.local # Optional: allows resolution of short names
/etc/resolv.conf, your changes might be overwritten after a reboot.For a permanent fix, it is usually better to:
Edit the Netplan configuration in
/etc/netplan/.Or, use
systemd-resolvedby linking the file:ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.confNote: If you are in a production environment, ensure that your AD DNS server is also configured to "Forward" requests to a public DNS (like 8.8.8.8) so your Ubuntu VM doesn't lose general internet access while searching for the domain.
Specific Netplan commands to make this DNS change permanent
IF you're working with a modern version of Ubuntu (like 20.04, 22.04, or 24.04), using Netplan is the most reliable way to ensure your DNS settings survive a reboot.
Here is how to apply the fix permanently:
1. Locate your Netplan Configuration
Netplan configuration files are YAML files located in /etc/netplan/. Run this command to find the filename:
(Common filenames are 01-netcfg.yaml, 50-cloud-init.yaml, or 00-installer-config.yaml.)
2. Edit the File
Open the file with root privileges (replace filename.yaml with your actual file name):
3. Add the DNS/Nameserver Info
Update the nameservers section under your network interface (usually eth0 or ens33). It should look like this:
network:
version: 2
ethernets:
eth0:
dhcp4: true
nameservers:
addresses: [192.168.1.10, 8.8.8.8] # Your AD DNS IP first, then a backup
search: [yourdomain.local] # Your AD Domain name
4. Apply the Changes
Save the file (Ctrl+O, Enter) and exit (Ctrl+X). Then, run:
How to Verify the Fix
Once applied, you can check if Ubuntu is actually talking to your Active Directory DNS by running:
Look for the "DNS Servers" section under your active interface to confirm your AD IP is listed.