Nu DNS seed with CloudFlare

Revision History  |  Suggest Update


This tutorial will show you how to run your own DNS seed.

It will describe how you can achieve this using nubits-seeder and cf-php.

Nubits-seeder is a small crawler, that checks for live nodes on NuNet. Cf-php is a script which queries the CloudFlare API and enters the seed nodes crawled by nubits-seeder into the DNS zone file.

You can find the repo for both programs here:

We will not talk much about nubits-seeder in this tutorial. Cf-php is where the magic happens.

What does cf-php do?

It reads a file called dnsseed.dump in the nubits-seeder root directory, which is continuously created when nubits-seeder is crawling for nodes. It will generate an IP-table from the dnseed.dump file and pushes this table to a CloudFlare (CF) enabled domain of your choice over the Cloudflare API.

A DNS zone file created by cf-php will look something like this:

;; ANSWER SECTION: 299 IN A 299 IN A 299 IN A 299 IN A 299 IN A 299 IN A 299 IN A 299 IN A 299 IN A 299 IN A

There is no need for you to run your own DNS server. It’s using the DNS servers provided by CloudFlare.


  • account
  • Domain (e. g. configured to use CF's DNS servers
  • small server (Raspberry Pis can easily handle this)
  • php5-cli, php5-curl, nubits-seeder repo
  • you may need to install lib-boost on your system to compile this (on Debian based systems: sudo apt-get install libboost-all-dev)

Let’s get started

  • Get your CF API Key ( -> My Settings -> Account -> API Key -> View API Key) and have it ready
  • install php5-cli and php5-curl
  • Download and start nubits-seeder

git clone
cd nubits-seeder
chmod +x dnsseed
screen -dmS nuseed sh -c "./dnsseed"
to have a screen session, detach the screen session with CTRL+A+D

  • Open cf-php/cf.php in an editor of your choice and edit the config paramters accordingly.

$domain ="";
$name = "nuseed"; //subdomain e.g. 
$number_of_records = 10; //maximum n A records with $name... 10 is recommended
$user = "emailofcloudflareaccount"; //user name
$key = "yourapikey"; //key for cloudflare api found in account settings
$seed_dump = "/path/to/dnsseed.dump"; //absolute path to dnsseed.dump in the nubits-seeder root directory

  • Have a cronjob run cf-php regularly

crontab -e
php ~/nubits-seeder/cf-php/cf.php

This will run the cf.php script every minute.

That should be it. You now have your own Nu DNS seed.