I’m in a bit of a bind here and could really use some help from the community. I’ve been trying to set up DNS nameservers on my Ubuntu system using Netplan, and honestly, it’s turning into quite the headache. I thought I was following all the steps correctly, but it doesn’t seem like my changes are actually taking effect.
So here’s the situation: I modified the YAML configuration file as I was instructed, adding the nameservers under the appropriate network interface. Everything looks good in the file, and I even double-checked for proper indentation since I know that YAML can be pretty picky about that. After saving the changes, I ran `sudo netplan apply`, but it feels like nothing has changed.
Here’s what my configuration looks like:
“`yaml
network:
version: 2
ethernets:
ens33:
dhcp4: true
nameservers:
addresses:
– 8.8.8.8
– 8.8.4.4
“`
I thought specifying Google’s public DNS servers would do the trick. But when I check my network settings, it still shows the old DNS servers. I’ve even rebooted the system just in case, but that didn’t help either.
I tried looking for logs to see if there were any error messages when applying the changes, but I didn’t find anything out of the ordinary. I’m kind of stuck here. Are there any other commands or tools in Ubuntu that can help verify if my settings are being applied correctly? Or maybe I’ve missed a step in the process?
I’m not the most seasoned Linux user, so I would appreciate any straightforward guidance. I’m eager to learn and fix this! If anyone has dealt with a similar issue, or if you have any troubleshooting tips, that would be super helpful. Thanks!
It seems like you’re on the right track with your YAML configuration for setting up DNS nameservers on your Ubuntu system. However, there are a few things you could check to troubleshoot why your changes aren’t taking effect. First, ensure that the YAML file is located in the correct directory, typically found at `/etc/netplan/`. After you run `sudo netplan apply`, it’s a good idea to check the status of your network interface and the applied configuration by running `ip a` and `systemd-resolve –status`. These commands can help you verify if the new nameservers are being recognized by the system. Additionally, double-check your indentation in the YAML file; YAML is sensitive to space, and any misalignment could cause Netplan to ignore your settings.
If everything appears to be in order and you’re still facing issues, consider using `netplan try` before applying the changes permanently. This command allows you to test your configuration and automatically revert to the previous settings if something goes wrong. Furthermore, check if the `resolv.conf` file located at `/run/systemd/resolve/resolv.conf` has been updated to reflect your new DNS settings. If you see the old servers there, it might indicate that there’s some other service, such as NetworkManager, overriding your configurations. In that case, you may need to stop that service or adjust its settings. With these steps in mind, you should be better positioned to solve the issue and enhance your understanding of networking in Ubuntu.
It sounds like you’re having a tough time with your DNS settings on Ubuntu using Netplan! No worries, we can figure this out together.
First off, your configuration file looks pretty solid at first glance! Just to double-check, remember that indentation in YAML is super important, and it seems like you have that covered already. But if it’s still not working, here are a few things you can try:
systemd-resolve --status
or
cat /etc/resolv.conf
This should show you the current DNS settings.
to:
and then set a static IP configuration along with the nameservers.
nmcli device status
If it is managed, you might need to configure it through NetworkManager instead.
journalctl -u systemd-networkd
This might give you some clues if there are any errors happening in the background.
After making any changes, make sure you run `sudo netplan apply` again! If you’re still stuck, don’t hesitate to share the output of the commands above. Good luck, and you’re doing great for someone just starting out!