Categories: TutorialsUbuntu

Troubleshooting Ethernet and DNS Issues in Ubuntu 24.04

When Ubuntu 24.04 users encounter network problems, they often face two main issues: one with the wired (Ethernet) connection and another with DNS resolution.

This guide provides a detailed, step‐by‐step approach to diagnose and fix both problems. Follow this Ubuntu 24.04 Ethernet troubleshooting guide and DNS resolution issues Ubuntu 24.04 article to get your network back online.

Introduction

Ubuntu 24.04 LTS brings many improvements, but upgrades and configuration changes can sometimes lead to network issues. Whether your Ethernet adapter is not recognized or your DNS settings seem misconfigured, the following sections will help you isolate the problem, check logs, and apply the proper fixes. This guide is ideal for IT administrators seeking a clear and practical approach using commands and configuration files.

Sponsored

Read: Configuring static and dynamic IP Addresses in Ubuntu using Netplan

Part 1: Troubleshooting Ethernet Issues

1.1. Identify the Problem

Sometimes, the Ethernet interface may show as “unmanaged” or display a “cable unplugged” error—even if the cable is connected. Common causes include driver mismatches, power management settings, or misconfigured NetworkManager settings.

Key Commands:

List network devices:
nmcli device status

Display detailed hardware information:
sudo lshw -C network

Check kernel logs for adapter errors:
sudo dmesg | grep -i eth

Read: Troubleshooting and Resolving Audio Issues in Ubuntu 24.04

1.2. Check Driver and Power Management Settings

If your Ethernet adapter is a USB device (common with Realtek chipsets such as RTL8156), it might be affected by power management.

Steps:

Verify the driver in use:
lspci -k | grep -A 3 -i ethernet

Disable USB autosuspend (if applicable):
Sometimes tools like TLP can turn off the adapter to save power. Temporarily disable USB autosuspend:

sudo echo ‘on’ | sudo tee /sys/bus/usb/devices/2-3/power/control

(Replace 2-3 with your device’s bus ID from the dmesg output.)

Read: How to extend your laptop battery lifespan on Linux Ubuntu/Debian

1.3. NetworkManager and Netplan Configuration

Ubuntu 24.04 uses netplan to generate network configuration files for NetworkManager or systemd-networkd. Misconfigurations here can cause the Ethernet interface to be ignored.

Verify Netplan Files:

List netplan configuration:
ls /etc/netplan

Open and review the YAML file:
sudo nano /etc/netplan/01-network-manager-all.yaml

Ensure your Ethernet interface is set to use DHCP or a static IP, and that there are no typos (YAML is indentation-sensitive).

Restart Services:

After any change, apply and restart the configuration:

sudo netplan apply

sudo systemctl restart NetworkManager

Sponsored

Read: How to Manage Ubuntu Boot Services: List, Start, and Stop Systemd Services at Startup

Part 2: Troubleshooting DNS Issues

2.1. Recognize DNS Symptoms

Common DNS issues in Ubuntu 24.04 include the inability to resolve hostnames (e.g., “Name or service not known”) even though you can ping IP addresses. This often results from problems with the systemd-resolved service or an improperly configured /etc/resolv.conf.

Key Commands:

Check DNS resolution:
ping -c 3 8.8.8.8

ping -c 3 www.google.com

Review the DNS configuration:
resolvectl status

cat /etc/resolv.conf

2.2. Verify Systemd-Resolved Status

Ubuntu 24.04 typically manages DNS using systemd-resolved, which creates a local stub resolver (usually at 127.0.0.53). If the service is not running or the symlink is broken, DNS resolution will fail.

Read: How to Configure Static and Dynamic IP Addresses in Ubuntu 24.04

Steps:

Check the status:
sudo systemctl status systemd-resolved

If not active, install or reinstall systemd-resolved:
sudo apt install systemd-resolved

sudo systemctl enable –now systemd-resolved

Recreate the resolv.conf symlink if necessary:
sudo rm -f /etc/resolv.conf

sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

2.3. Investigate Netplan and DHCP Settings

Sometimes, an upgrade or misconfigured netplan file can lead to DNS problems, especially if the DHCP client does not pass the proper DNS server to the system.

Steps:

Review your netplan file:
sudo nano /etc/netplan/01-network-manager-all.yaml

Ensure the nameservers section lists the correct DNS (for example, your router’s IP or a public DNS like 8.8.8.8).

Apply changes:
sudo netplan apply

2.4. Advanced DNS Troubleshooting

If you still face DNS issues, additional steps may include:

Flushing the DNS cache:
sudo systemd-resolve –flush-caches

Checking for conflicting services:
Ensure that no other DNS service (such as dnsmasq) is interfering.

Reviewing /etc/nsswitch.conf:
Confirm that the hosts line includes DNS:

hosts: files mdns4_minimal [NOTFOUND=return] dns

Read: What are DNS record types

Conclusion

Following these troubleshooting steps, you can resolve both Ethernet and DNS issues on Ubuntu 24.04. This guide covered driver verification, power management adjustments, netplan and NetworkManager configuration, and fixing the systemd-resolved DNS service. With careful diagnosis using commands like nmcli device status, lshw -C network, and resolvectl status, IT administrators can quickly pinpoint and resolve network problems. Whether it’s a USB Ethernet troubleshooting Ubuntu 24.04 or fixing DNS resolution issues Ubuntu 24.04, these methods ensure your system remains reliable and fully connected.

.

 

The post Troubleshooting Ethernet and DNS Issues in Ubuntu 24.04 appeared first on net2.

Ubuntu Server Admin

Recent Posts

Ubuntu Weekly Newsletter Issue 881

Welcome to the Ubuntu Weekly Newsletter, Issue 881 for the week of February 23 –…

6 hours ago

Experiment Tracking with MLFlow in Canonical’s Data Science Stack

Welcome back, data scientists! In my previous post, we explored how easy it is to…

14 hours ago

How to Install vLLM on Linux Using 4 Easy Steps

In this article, we will see how to install vLLM on Linux using 4 easy…

17 hours ago

Ubuntu Weekly Newsletter Issue 880

Welcome to the Ubuntu Weekly Newsletter, Issue 880 for the week of February 16 –…

2 days ago

Ubuntu Weekly Newsletter Issue 880

Welcome to the Ubuntu Weekly Newsletter, Issue 880 for the week of February 16 –…

2 days ago

Ubuntu 24.04.2 LTS released

The Ubuntu team is pleased to announce the release of Ubuntu 24.04.2 LTS (Long-Term Support)…

2 days ago