Sia Docs
GithubDiscordYouTubeBlogsRedditForum
Legacy
Legacy
  • Welcome to Sia!
  • Get Started with Sia
    • Introduction to these docs
    • Sia 101
    • What are Siacoins?
    • How to buy Siacoins
    • What is the Siacoin total supply?
  • Your Sia Wallet
    • Wallet overview
    • The importance of your seed
    • How to make a Sia address
    • How to send Siacoins
    • How do I change my Sia wallet password?
    • Back up your Sia wallet
    • Wallet troubleshooting
      • Delete your seed and make a new one
      • Find or fix your seed
      • I lost my seed. What do I do?
      • My deposit or withdrawal didn't go through
      • Why does Sia take so long to sync?
      • What are these deductions in my wallet?
      • Why does Sia-UI give me a new address each time I click Receive Siacoin?
    • Sia-UI FAQs
      • How to download and install Sia-UI
      • How to make a new wallet in Sia-UI
      • How to restore a wallet from a seed in Sia-UI
      • How to perform a clean install in Sia-UI
      • How do I uninstall Sia-UI?
    • For Advanced Users
      • Verify the Sia release signature
      • Using Sia on a remote node
      • Using Sia on multiple computers
      • How to bootstrap the Sia blockchain
      • How to automatically restart and unlock Sia
      • How to set an environment variable
    • 🚧walletd
      • Wallet overview
  • Renting
    • About renting on Sia
    • Managing your files
    • How to rent storage on Sia
    • How to back up and restore your files
    • Renter troubleshooting
    • Is my data secure?
    • 🚧renterd
      • About renting on Sia
      • renterd Workshop
  • Hosting
    • About hosting on Sia
    • Hosting with the Sia-UI GUI
    • Hosting with the siad CLI on Linux
    • Hosting FAQ
    • 🚧hostd
      • About hosting on Sia
      • Setup Guides
        • Linux
        • macOS
        • Windows
      • Dynamic DNS
        • DuckDNS
        • Cloudflare (Advanced)
  • Mining
    • About mining on Sia
    • Sia mining pools
  • Contributing
    • How can I contribute to Sia?
    • Where can I learn more about Sia?
  • Siafunds
    • What are Siafunds?
    • How do I buy Siafunds?
    • How to cash out Siafunds
    • SEC Settlement FAQ
  • Sia Integrations
    • Listing Siacoin on your exchange
    • Using the Sia Ledger app with Sia Central
    • Using the Sia Ledger Nano app with CLI
    • Brand guidelines for Sia in your project or site
  • Testnet
    • What is Zen?
  • Forks
    • Using the wrong chain after a fork
    • Navigating the 2021 Sia hardfork
    • So, you didn't update in time for the fork
Powered by GitBook
On this page
  • Things you'll need
  • Add your domain to Cloudflare
  • Get your Zone ID
  • Create an API token
  • Configure hostd

Was this helpful?

Edit on GitHub
  1. Hosting
  2. hostd
  3. Dynamic DNS

Cloudflare (Advanced)

Learn how to setup dynamic DNS in hostd with Cloudflare

PreviousDuckDNSNextAbout mining on Sia

Last updated 1 year ago

Was this helpful?

Cloudflare DNS is a globally distributed, fast, secure, and free Domain Name System (DNS) service that offers top-level domain resolution with robust security features and increased site performance. This guide will walk you through setting up Cloudflare for DDNS in hostd.

Things you'll need

  • A registered domain name (Cloudflare, NameCheap, GoDaddy, Google Domains)

  • Basic familiarity with DNS

  • A running hostd node

  • A Cloudflare account

This guide assumes that you already have a domain registered and can change its nameservers to Cloudflare.

Add your domain to Cloudflare

Once you've logged into Cloudflare, it's time to add your domain. If your domain is already added, skip to the next step. The site may look slightly different if your account already has a domain. To start the process, click the "Add Site" button.

When adding the site, you will be asked which plan you would like. At the very bottom, select the Free plan since we only need DNS.

Add DNS records for your host. We will be using myfamoushost.sia.tools for this guide.

  1. For IPv4, add an "A" record.

  2. For IPv6, add an "AAAA" record.

  3. Toggle "Proxy" off. Sia uses a custom TCP protocol that cannot be proxied by Cloudflare.

  4. Click "Save"

Follow the remaining steps on Cloudflare's website to change your domain's nameservers to Cloudflare. Wait until the nameserver change is confirmed and the site is active in Cloudflare.

Get your Zone ID

On the website Dashboard in the right-hand column is your domain's "Zone ID." Copy the Zone ID for later.

Create an API token

Next, we need to create an API token for Cloudflare. An API token allows hostd to access your Cloudflare DNS without needing your email or password.

  1. Click the account icon in the top right corner of the page.

  2. Click "My Profile" in the dropdown.

  3. Click "API Tokens" in the sidebar on the left

  4. Click "Create Token"

We will now create a token with only write access to the zone we created. In the API token templates click "Use Template" next to "Edit zone DNS."

Under "Permissions," make sure that the token has the "Edit" permission on the DNS. Under "Zone Resources," make sure to "Include" the "Specific Zone" and select the domain we just added. Since you likely have a dynamic IP, leave "Client IP Address Filtering" blank. TTL is optional, but you will need to remember to create a new token, or your DDNS will break.

Once you have set the permissions, click "Continue to summary." On the summary screen, double-check that the token has DNS Edit access to the Zone we just added and click "Create". The token will be displayed on your screen. Copy the token now. Once you leave the page, it will not be shown again.

Configure hostd

It's finally time to configure hostd and enable DDNS.

  1. Access the hostd UI, http://localhost:9980 by default

  2. Click the "Configuration" icon in the sidebar

  3. Change the "Address" field to the domain name you set up. (e.g. myfamoushost.sia.tools:9982)

  1. Scroll to the "DNS" section

  2. Change "Dynamic DNS Provider" to "Cloudflare"

  3. Turn on IPv4 and/or IPv6, depending on your setup

  4. In the "Token" field copy the API token we created

  5. In the "Zone ID" field copy the Zone ID

If you changed the settings correctly, you should see "Dynamic DNS enabled" in the top status bar. You will also need to announce your new net address so renters will be able to connect. hostd will now update your Cloudflare DNS record when your IP address changes.

To get your current public IP go to .

🚧
https://icanhazip.com
Cloudflare Dashboard
Select Free plan
Add a new record
Cloudflare Zone ID
Cloudflare "Create Token" button
Cloudflare token template
Cloudflare token permissions
A new API token