{"id":47,"date":"2025-01-31T20:42:02","date_gmt":"2025-01-31T20:42:02","guid":{"rendered":"https:\/\/blog.thebowrings.co.uk\/?p=47"},"modified":"2025-04-18T17:45:22","modified_gmt":"2025-04-18T16:45:22","slug":"ha-duckdns-setup","status":"publish","type":"post","link":"https:\/\/blog.thebowrings.co.uk\/index.php\/2025\/01\/31\/ha-duckdns-setup\/","title":{"rendered":"How to setup DuckDNS in Home-Assistant"},"content":{"rendered":"<figure style=\"aspect-ratio:auto;width:200px;height:100px; padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;\" class=\"wp-block-post-featured-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1067\" height=\"256\" src=\"https:\/\/blog.thebowrings.co.uk\/wp-content\/uploads\/2025\/01\/DuckDNS.png\" class=\"attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" style=\"width:100%;height:100%;object-fit:contain;\" srcset=\"https:\/\/blog.thebowrings.co.uk\/wp-content\/uploads\/2025\/01\/DuckDNS.png 1067w, https:\/\/blog.thebowrings.co.uk\/wp-content\/uploads\/2025\/01\/DuckDNS-300x72.png 300w, https:\/\/blog.thebowrings.co.uk\/wp-content\/uploads\/2025\/01\/DuckDNS-1024x246.png 1024w, https:\/\/blog.thebowrings.co.uk\/wp-content\/uploads\/2025\/01\/DuckDNS-768x184.png 768w\" sizes=\"auto, (max-width: 1067px) 100vw, 1067px\" \/><\/figure>\n\n\n<p>This guide will help you setup DuckDNS with Home assistant, this is useful to give your home assistant a domain name to access it outside of your home. DuckDNS provide free DNS names but also provide Dynamic DNS resolution.<\/p>\n\n\n\n<p>At home most people have dynamic IP addresses on their router, this means that the internet address issued by your service provider changes periodically. Domain names like blah.duckdns.org need to point to an IP address, and if the IP address changes the website will not work.<\/p>\n\n\n\n<p>DuckDNS helps keep your domain name up to date as your IP address changes but also gives you a free domain name to use to access your site.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>What You\u2019ll Need:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Home Assistant<\/strong> (We recommend Home Assistant Green for easy setup: <a href=\"https:\/\/www.home-assistant.io\/green\">Home Assistant Green<\/a>)<\/li>\n\n\n\n<li><strong>Basic Configuration<\/strong> (Complete the onboarding guide: <a href=\"https:\/\/www.home-assistant.io\/getting-started\/onboarding\/\">Home Assistant Onboarding<\/a>)<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Section 1: Set Up Port Forwarding (Including Finding Your Home Assistant IP)<\/h4>\n\n\n\n<p><strong>What is Port Forwarding ?<\/strong><br>Think of your router as the gatekeeper to your home network. When you\u2019re away, it\u2019s like trying to get mail delivered to a specific room in a big house. Without clear instructions (port forwarding), the router doesn\u2019t know where to send the data request. Setting up port forwarding tells the router to route requests for Home Assistant to the right device in your network.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Step 1: Find Your Home Assistant\u2019s IP Address<\/h5>\n\n\n\n<p>You need this IP address to tell the router where to send the data.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open Home Assistant on your browser (e.g., http:\/\/homeassistant.local:8123).<\/li>\n\n\n\n<li>Go to <strong>Settings<\/strong> &gt; <strong>System<\/strong> &gt; <strong>Network<\/strong>.<\/li>\n\n\n\n<li>Look for the <strong>IPv4 Address<\/strong> (e.g., 192.168.1.100). This is the internal IP of your Home Assistant device.<\/li>\n<\/ol>\n\n\n\n<p>Make a note of this address. You\u2019ll use it in the next step.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Step 2: Access Your Router\u2019s Settings<\/h5>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open a browser and enter 192.168.1.1 (or your router\u2019s gateway IP).<\/li>\n\n\n\n<li> Log in with your admin username and password (usually found on the back of your router).<\/li>\n<\/ol>\n\n\n\n<h5 class=\"wp-block-heading\">Step 3: Configure Port Forwarding<\/h5>\n\n\n\n<p>Once logged in, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Navigate to <strong>Advanced Settings<\/strong>, <strong>Firewall<\/strong>, or <strong>Port Forwarding<\/strong> (menu names vary).<\/li>\n\n\n\n<li>Look for an option to add or create new port forwarding rules.<\/li>\n<\/ol>\n\n\n\n<p>Create the following two rules:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Rule 1 <\/strong>(Port 8123)<strong>:<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Name:<\/strong> Home Assistant 8123<\/li>\n\n\n\n<li><strong>Internal IP:<\/strong> The IP you found earlier (e.g., 192.168.1.100)<\/li>\n\n\n\n<li><strong>Protocol:<\/strong> TCP\/UDP<\/li>\n\n\n\n<li><strong>Internal Port:<\/strong> 8123<\/li>\n\n\n\n<li><strong>External Port:<\/strong> 8123<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Rule 2 <\/strong>(Optional, for SSL\/TLS encryption on port 443):\n<ul class=\"wp-block-list\">\n<li><strong>Name:<\/strong> Home Assistant 4430<\/li>\n\n\n\n<li> <strong>Internal IP:<\/strong> Same as above<\/li>\n\n\n\n<li><strong>Protocol:<\/strong> TCP\/UDP<\/li>\n\n\n\n<li><strong>Internal Port:<\/strong> 443<\/li>\n\n\n\n<li><strong>External Port:<\/strong> 443<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">Step 4: Save and Test<\/h5>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Save the changes on your router.<\/li>\n\n\n\n<li>Try accessing Home Assistant from outside your home network using your <strong>Duck DNS URL<\/strong>, e.g., https:\/\/yourname.duckdns.org:8123.<\/li>\n<\/ol>\n\n\n\n<h5 class=\"wp-block-heading\">Step 5: . Assign a Static IP to Home Assistant<\/h5>\n\n\n\n<p><strong>What Is a Static IP?<\/strong><\/p>\n\n\n\n<p>Think of an IP address like a phone number for devices on your network. By default, routers assign dynamic (changing) IPs. This means your Home Assistant\u2019s IP address could change over time. If it changes, your port forwarding rules won\u2019t work.<\/p>\n\n\n\n<p>A <strong>static IP<\/strong> is a fixed address that never changes. Assigning a static IP ensures your router always knows where to direct incoming traffic.<\/p>\n\n\n\n<p><strong>How to Assign a Static IP:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In your router\u2019s settings, find <strong>Device List<\/strong> or <strong>Connected Devices<\/strong>.<\/li>\n\n\n\n<li>Locate your Home Assistant device by matching the IP or MAC address.<\/li>\n\n\n\n<li>Look for an option like <strong>Reserve IP<\/strong>, <strong>Assign Static IP<\/strong>, or <strong>IP Binding<\/strong>.<\/li>\n\n\n\n<li>Enter the current IP address of your Home Assistant (e.g., 192.168.1.100).<\/li>\n\n\n\n<li>Save the settings.<\/li>\n<\/ol>\n\n\n\n<p>This step prevents your router from reassigning a different IP to Home Assistant.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Section 2: Register on Duck DNS<\/h4>\n\n\n\n<p>Set up the add-on to connect your Duck DNS address to Home Assistant.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the Duck DNS add-on.<\/li>\n\n\n\n<li>Click <strong>\u201cConfiguration.\u201d<\/strong><\/li>\n\n\n\n<li>Fill in the details:\n<ul class=\"wp-block-list\">\n<li>Paste your <strong>token<\/strong> (from Duck DNS).<\/li>\n\n\n\n<li>Enter your <strong>domain name<\/strong> (<em>myhome.duckdns.org<\/em>).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Enable SSL certificates for secure access by adding the line accept_terms: true under lets_encrypt:.<br><br>Here\u2019s an example configuration:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code has-tertiary-background-color has-background\"><code>lets_encrypt:\n  accept_terms: true\n  certfile: fullchain.pem\n  keyfile: privkey.pem\ntoken: your_duckdns_token_here\ndomains:\n  - myhome.duckdns.org\n<\/code><\/pre>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li>Save the configuration and then <strong>start the add-on<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h5 class=\"wp-block-heading\">Step 3: Update Home Assistant Configuration<\/h5>\n\n\n\n<p>Update your Home Assistant settings to use secure access.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install the <strong>File Editor<\/strong> add-on:\n<ul class=\"wp-block-list\">\n<li>Go to \u201cSettings\u201d &gt; \u201cAdd-ons\u201d &gt; \u201cAdd-on Store.\u201d<\/li>\n\n\n\n<li>Search for <strong>File Editor<\/strong>, install it, and start the add-on.<\/li>\n\n\n\n<li>Open the File Editor from the sidebar and locate the <strong>configuration.yaml<\/strong> file.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Add or update the http: section with:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code has-tertiary-background-color has-background\" style=\"border-style:none;border-width:0px;margin-top:0;margin-bottom:0\"><code>http:\n  ssl_certificate: \/ssl\/fullchain.pem\n  ssl_key: \/ssl\/privkey.pem\n<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li style=\"margin-right:0;margin-left:0\">Save the file<\/li>\n<\/ol>\n\n\n\n<h5 class=\"wp-block-heading\">Step 4: Restart Home Assistant<\/h5>\n\n\n\n<p>Restart Home Assistant to apply the changes. Here\u2019s how:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Click <strong>\u201cSettings\u201d<\/strong> on the sidebar.<\/li>\n\n\n\n<li>Select <strong>\u201cSystem.\u201d<\/strong><\/li>\n\n\n\n<li>Scroll down to <strong>\u201cHardware\u201d<\/strong> and click <strong>\u201cRestart.\u201d<\/strong><\/li>\n<\/ol>\n\n\n\n<p>Wait a few minutes for Home Assistant to reboot.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Step 5: Set the Home Assistant URL<\/h5>\n\n\n\n<p>Tell Home Assistant to use your new Duck DNS URL.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to <strong>Settings<\/strong> &gt; <strong>System<\/strong> &gt; <strong>Network.<\/strong><\/li>\n\n\n\n<li>In the <strong>Home Assistant URL<\/strong> field, enter your secure address: https:\/\/myhome.duckdns.org.<\/li>\n\n\n\n<li>Save your changes.<\/li>\n<\/ol>\n\n\n\n<h5 class=\"wp-block-heading\">Step 6: Test Your Setup<\/h5>\n\n\n\n<p>Verify that everything works.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open a browser and visit https:\/\/myhome.duckdns.org.<\/li>\n\n\n\n<li>You should see your Home Assistant login page. If it doesn\u2019t load, check for errors in your configuration.<\/li>\n<\/ol>\n\n\n\n<p><strong>Analogy Recap<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Duck DNS<\/strong> gives your system an address on the internet.<\/li>\n\n\n\n<li><strong>A subdomain<\/strong> is your unique address (like a house number).<\/li>\n\n\n\n<li><strong>The add-on<\/strong> forwards requests to your Home Assistant.<\/li>\n\n\n\n<li><strong>SSL certificates<\/strong> secure the connection, like security guards checking visitors.<\/li>\n\n\n\n<li><strong>Restarting Home Assistant<\/strong> is like rebooting the system to apply new settings.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Out of the box home-assistant comes pre-configured to use http and as a result all communications are insecure. Any hacker &#8220;could&#8221; intercept and read communications to your home-assistant.<\/p>\n","protected":false},"author":1,"featured_media":97,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[24,20,19],"class_list":["post-47","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-home-assistant","tag-duckdns","tag-ha","tag-https"],"_links":{"self":[{"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":17,"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":148,"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/47\/revisions\/148"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/media\/97"}],"wp:attachment":[{"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thebowrings.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}