Setting Up a Home Lab Server Accessible Externally with a Dynamic IP using Duck DNS
In this article, we will cover the process of setting up a home lab server that can be accessed externally from anywhere in the world. We will use Duck DNS as a workaround for the dynamic IP address provided by most Internet Service Providers (ISPs).
Prerequisites
- A home lab server with an operating system installed (e.g. Ubuntu Server)
- A router that supports port forwarding
- A Duck DNS account
Setting Up Duck DNS
The first step is to set up a Duck DNS account. This will give you a subdomain that you can use to access your home lab server from anywhere in the world. To set up a Duck DNS account, follow these steps:
- Go to the Duck DNS website
- Click on the "Get Started" button
- Enter your desired subdomain and password, then click on the "Create" button
- Make a note of your API token
Setting Up Port Forwarding
The next step is to set up port forwarding on your router. This will allow incoming traffic on a specific port to be forwarded to your home lab server. To set up port forwarding, follow these steps:
- Log in to your router's web interface
- Find the port forwarding settings (this may be under "Advanced" or "Security")
- Create a new port forwarding rule
- Enter the following information:
- Service Name: Duck DNS
- External Port: 80
- Protocol: TCP
- Internal Port: 80
- IP Address: The IP address of your home lab server
- Save the changes
Installing Duck DNS Client
The next step is to install the Duck DNS client on your home lab server. This will automatically update your Duck DNS subdomain with your current IP address. To install the Duck DNS client, follow these steps:
- Connect to your home lab server via SSH
- Install the required packages:
- Clone the Duck DNS client repository:
- Edit the configuration file:
- Enter your Duck DNS subdomain and API token:
- Save the changes and exit
- Start the Duck DNS client:
sudo apt-get update
sudo apt-get install git
git clone https://github.com/andrew-d/static-dns.git
nano duckdns.conf
duckdns.domain=yoursubdomain.duckdns.org
duckdns.token=yourapikey
cd static-dns
sudo ./duckdns -config duckdns.conf &
Testing the Setup
The final step is to test the setup. To do this, open a web browser and enter your Duck DNS subdomain (e.g.
- Make sure your home lab server is running and connected to the internet
- Make sure port forwarding is set up correctly on your router
- Make sure the Duck DNS client is running and updating your subdomain with your current IP address
In this article, we covered the process of setting up a home lab server that can be accessed externally from anywhere in the world. We used Duck DNS as a workaround for the dynamic IP address provided by most ISPs. We also covered the prerequisites, setting up Duck DNS, setting up port forwarding, installing the Duck DNS client, and testing the setup.
References
- Duck DNS: https://www.duckdns.org/
- Static DNS: https://github.com/andrew-d/static-dns