Ubuntu Post Tag - TechOpt.io https://www.techopt.io/tag/ubuntu Programming, servers, Linux, Windows, macOS & more Tue, 17 Jun 2025 02:59:36 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 https://www.techopt.io/wp-content/uploads/2024/07/cropped-logo-1-32x32.png Ubuntu Post Tag - TechOpt.io https://www.techopt.io/tag/ubuntu 32 32 Setting a Static IP Address and DNS in Ubuntu Server https://www.techopt.io/linux/setting-a-static-ip-address-and-dns-in-ubuntu-server https://www.techopt.io/linux/setting-a-static-ip-address-and-dns-in-ubuntu-server#respond Wed, 09 Apr 2025 00:13:28 +0000 https://www.techopt.io/?p=883 If you’re running Ubuntu Server and need to configure a static IP address, you might have seen guides mentioning /etc/network/interfaces or resolvconf. However, these methods are outdated. The recommended way today is to use netplan. In this guide, you’ll discover how to set a static IP in Ubuntu and define custom DNS settings, including nameservers […]

The post Setting a Static IP Address and DNS in Ubuntu Server appeared first on TechOpt.

]]>
If you’re running Ubuntu Server and need to configure a static IP address, you might have seen guides mentioning /etc/network/interfaces or resolvconf. However, these methods are outdated. The recommended way today is to use netplan.

In this guide, you’ll discover how to set a static IP in Ubuntu and define custom DNS settings, including nameservers and search domains. Additionally, we’ll explain how to keep DHCP while specifying DNS servers for better control.

Why Should You Set a Static IP on Ubuntu Server?

Assigning a static IP ensures your server retains the same address across reboots. This reliability is essential for servers running web services, databases, or acting as internal network resources.

Step 1: Identify Your Ubuntu Server Network Interface

To begin, list your network interfaces:

ip link

You’ll usually see names like eth0, ens33, or enp0s3.

Step 2: Edit the Netplan Configuration

Netplan configurations are stored in /etc/netplan/. View the files with:

ls /etc/netplan/

Next, edit the YAML file (replace with your actual file name):

sudo nano /etc/netplan/50-cloud-init.yaml

Here’s an example static IP configuration for Ubuntu Server:

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: no
      addresses:
        - 192.168.1.100/24
      routes:
        - to: default
          via: 192.168.1.1
      nameservers:
        search: [yourdomain.local]
        addresses:
          - 1.1.1.1
          - 1.0.0.1

Replace eth0 with your interface name. Adjust the IP, gateway, and DNS to match your network.

Important: Some older guides might mention using the gateway4 parameter. However, gateway4 has been deprecated. It’s better to use the routes section, as demonstrated above, for better compatibility with future Ubuntu versions.

Step 3: Apply the Static IP Ubuntu Configuration

Once you have finished editing, apply the changes with:

sudo netplan apply

To confirm your new settings, run:

ip a

This command will display your active IP address. To confirm your DNS configuration is working, you can run:

apt update


This will refresh the built-in software repositories, and as long as it’s successful you know that your DNS configuration is working.

Alternative: Keep DHCP but Configure DNS in Ubuntu Server

If you prefer to use DHCP for IP assignment but still want to control DNS servers, use this configuration:

network:
  version: 2
  ethernets:
    eth0:
      dhcp4: yes
      dhcp4-overrides:
        use-dns: no
      nameservers:
        search: [yourdomain.local]
        addresses:
          - 1.1.1.1
          - 1.0.0.1

This method allows the server to receive its IP address from the DHCP server, while your specified DNS servers handle name resolution.

Conclusion

To sum up, netplan is the modern, recommended tool for configuring a static IP Ubuntu setup. You should avoid older methods like resolvconf or editing /etc/network/interfaces, as they are deprecated in the latest Ubuntu versions. Whether you need a full static IP or simply want to control your DNS while keeping DHCP, netplan makes the process clear and manageable.

If you would like to learn about all the configuration options for netplan, you can read the official Netplan documentation.

If you would prefer to view this guide in video form, I’ve created a video explaining these instructions on the TechOpt.io YouTube channel, which you can watch below:

The post Setting a Static IP Address and DNS in Ubuntu Server appeared first on TechOpt.

]]>
https://www.techopt.io/linux/setting-a-static-ip-address-and-dns-in-ubuntu-server/feed 0
Upgrade Ubuntu 20.04 LTS to 22.04 LTS https://www.techopt.io/linux/upgrade-ubuntu-20-04-lts-to-22-04-lts https://www.techopt.io/linux/upgrade-ubuntu-20-04-lts-to-22-04-lts#respond Sun, 23 Feb 2025 17:24:13 +0000 https://www.techopt.io/?p=814 Ubuntu 20.04 LTS (Focal Fossa) is nearing its end-of-life (EOL) in April 2025. If you’re still running Ubuntu 20.04 LTS on a system, now is a good time to consider upgrading to Ubuntu 22.04 LTS (Jammy Jellyfish). In my case, I have been using Ubuntu 20.04 LTS specifically for running the TP-Link Omada Controller, which […]

The post Upgrade Ubuntu 20.04 LTS to 22.04 LTS appeared first on TechOpt.

]]>
Ubuntu 20.04 LTS (Focal Fossa) is nearing its end-of-life (EOL) in April 2025. If you’re still running Ubuntu 20.04 LTS on a system, now is a good time to consider upgrading to Ubuntu 22.04 LTS (Jammy Jellyfish). In my case, I have been using Ubuntu 20.04 LTS specifically for running the TP-Link Omada Controller, which historically ran best on older LTS versions. Upgrading from Ubuntu 20.04 LTS to 22.04 LTS ensures continued security updates, bug fixes, and stability while staying on a supported version.

Why Upgrade Now?

Ubuntu LTS (Long-Term Support) versions receive five years of updates, meaning 20.04 will stop receiving standard support in April 2025. While Ubuntu does offer Extended Security Maintenance (ESM) for an additional five years, that requires an Ubuntu Pro subscription, which costs money and may not be ideal for all users.

Checking Software Compatibility Before Upgrading

One of the main reasons I stayed on Ubuntu 20.04 was because I run the TP-Link Omada Controller, which historically ran best on older LTS versions. However, as of now, Omada supports Ubuntu 22.04 LTS, making this a good time to upgrade.

If you’re running custom software, self-hosted services, or enterprise applications, check their documentation or forums to confirm compatibility before proceeding.

Steps to Upgrade from Ubuntu 20.04 LTS to 22.04 LTS

To ensure a smooth upgrade, follow these steps:

1. Back Up Your System

Before making major changes, always back up important data. If you’re running a production server, consider creating a full system snapshot using tools like:

  • Timeshift (for desktop users)
  • rsync or tar for manual backups
  • Btrfs snapshots (if you’re using a Btrfs filesystem)

I also backed up my Omada configuration through the web administration page, as well as made a snapshot of the virtual machine in Proxmox.

2. Update Ubuntu 20.04 Fully

Before upgrading, ensure your system is fully up to date. Run the following commands:

sudo apt update && sudo apt upgrade -y
sudo apt full-upgrade -y
sudo apt autoremove --purge -y

After the updates complete, reboot your system:

sudo reboot

3. Start the Upgrade Process

Once back online, use the following command to begin the upgrade:

sudo do-release-upgrade

This will check for a new release and guide you through the upgrade process.

4. Follow the On-Screen Prompts

  • The upgrade tool will download necessary packages and warn you about changes.
  • If prompted to replace configuration files, choose the default option unless you’ve manually customized them.
  • When prompted to remove obsolete packages, confirm with Y.
  • The process may take some time depending on your internet speed and system resources.

5. Reboot Into Ubuntu 22.04

After the upgrade is complete, reboot your system:

sudo reboot

Once your system boots up, confirm the upgrade with:

lsb_release -a

This should display Ubuntu 22.04 LTS.

Post-Upgrade Checks

  1. Verify Software Functionality – Ensure your applications and services, like the TP-Link Omada Controller, are running properly.
  2. Check for Remaining Updates – Run: sudo apt update && sudo apt upgrade -y
  3. Remove Old Packages – Clean up unnecessary files: sudo apt autoremove --purge -y

Conclusion

Upgrading from Ubuntu 20.04 LTS to 22.04 LTS is straightforward but requires some preparation. Since Ubuntu 20.04 reaches EOL in April 2025, it’s best to upgrade sooner rather than later to stay secure and supported. If you run software that relies on very specific versions on Ubuntu (such as the TP-Link Omada Controller), ensure it’s compatible before proceeding.

The post Upgrade Ubuntu 20.04 LTS to 22.04 LTS appeared first on TechOpt.

]]>
https://www.techopt.io/linux/upgrade-ubuntu-20-04-lts-to-22-04-lts/feed 0