DNS servers turn names such as example.com into IP addresses. In Ubuntu Desktop, GNOME Settings lets you choose which IPv4 DNS servers a wired connection uses.
The connection can still get its IP address and gateway automatically through DHCP. The DNS setting belongs to the wired connection profile. Other connections keep their own DNS settings.
Some work and school networks use their DNS servers to resolve internal names. A public DNS server may be able to look up websites while leaving those internal names unresolved.
Steps to change DNS servers in Ubuntu (GNOME):
Start on the local Ubuntu 26.04 LTS desktop with one active wired connection whose Wired profile gets its IPv4 address through DHCP. In that profile's IPv4 tab, Automatic is on under DNS and the DNS address field is empty. The wired link has no IPv6 DNS servers. You need permission to change the connection, the new servers' IPv4 addresses, and a fully qualified domain name they can resolve, such as example.com.
- Open the system menu in the top-right corner.

- Click the arrow next to Wired.

- Click Wired Settings to open the Network panel.

- Click the gear next to the connected Wired connection.

- Select the IPv4 tab in the wired connection editor.

- Turn off Automatic in the DNS section.
The IPv4 Method stays set to Automatic (DHCP). The IPv6 tab has its own DNS settings for servers supplied over IPv6. Turning off Automatic DNS also drops the search domains supplied over IPv4, so short names can stop resolving even when the new servers work.
- Click the DNS address field.

- Enter your DNS server addresses in the field as a comma-separated list.
The example uses
1.1.1.1and1.0.0.1. - Click Apply to save the DNS settings.
If the new servers cannot resolve names, you can restore the previous settings from IPv4 by clearing the DNS field, turning Automatic back on under DNS, applying the change, and reconnecting.
Switching Wired off in the next step briefly disconnects the computer from the network. The local desktop stays available so you can turn the connection back on.
- Switch Wired off in the Network panel.

- Switch Wired back on.

- Reopen the connection details with the gear next to Wired once the row reads Connected.

- Confirm that DNS on the Details tab lists the servers you entered.

- Open Terminal with Ctrl+Alt+T.
- Check that the single wired Link row in
resolvectl dnslists exactly the IPv4 DNS servers you entered.$ resolvectl dns Global: Link 2 (enp0s5): 1.1.1.1 1.0.0.1
If there is more than one wired link, or if the wired row is missing, omits an address you entered, or lists an extra address, stop before the lookup.
- Query your chosen fully qualified domain name with
resolvectl queryusing the interface name in parentheses on the wired Link row that passed the previous check.$ resolvectl query -i enp0s5 -p dns --cache=no example.com example.com: 2606:4700:10::6814:179a -- link: enp0s5 ##### snipped ##### -- Data from: network
The example queries
example.comonenp0s5with the DNS cache disabled. A successful lookup returns an IP address on your chosen link and reportsData from: network.