Author

Topic: DNS Seeder Setup Guide (Using the generic-seeder) (Read 533 times)

jr. member
Activity: 43
Merit: 16
Does not work with CloudFlare, did everything mentioned in this topic, nothing worked.

I can confirm that cloudflare mode is working as expected. There are a number of steps and many points of failure to this process. If you would like help, please provide much more detail about what you have tried that didn't work, error msgs, etc.

Some questions that may help to determine where you are going wrong:

-Are you able to crawl your network and find "good" nodes, or no? (ie: what does the contents of the dnsseed.dump file look like?)
-Did you already get confirmation from cloudflare that your domain has been activated with cloudflares nameservers?
-Can you post a portion of the output from the "python3 seeder.py" cmd?
newbie
Activity: 19
Merit: 0
Does not work with CloudFlare, did everything mentioned in this topic, nothing worked.
full member
Activity: 486
Merit: 104

In order to support several Altcoins on a single machine / VPS, we have built upon Joe's work with generic-seeder to create multiseeder.

multiseeder examines the DNS query packet to select which set of IP nodes, from the several coin networks it tracks, it will give the asking client.

https://bitcointalksearch.org/topic/m.58962384
jr. member
Activity: 43
Merit: 16
no i had to rebuild it because i reinstalled my operating system. i didn't know you could just install it into another directory.

i backed up the generic seeder directory though. i plugged in the old setting file and it fired up again. im not sure i have the settings completely correct though.

ive had it running with these settings for two week with no dump



i left the min_peer_proto_version blank and that gave me the error even though it is optional :/

do i want to use the RPC port or the P2P port for the port number?

also, my explorer_url and second_explorer_url are left blank so what should my block count be?


thanks for your help

All of the settings are required to be in the config file, but the optional values can be blank strings which are just two double quotes. For example: min_peer_proto_version=""

As explained in the full setup guide, the wallet_port value is the main port # that is used to connect to the wallets in your blockchain. This is NOT the rpc port #.

If you do not have access to an explorer with api to the current block count, you should set the block_count value to the most recent block at the time of starting the seeder. Over time this will allow bad nodes that are stuck on blocks higher than that number to be counted as "good" nodes, so I would recommend using at least one explorer to prevent this.

Also, I've updated the github repo with better error handling of the dump file and included a few example configs for bitcoin, dogecoin and exor that you can use to test the seeder to get a better idea of how it works and see some working examples of how to properly fill out the config file. If you do use the sample configs for testing, be sure to delete the dnsseed.dat and dnsseed.dump files to prevent mixing of the two networks in your results, or else just start again with cloning the github repo to a fresh directory and configure your real network once you have a better idea of how it should look when it is working.
jr. member
Activity: 57
Merit: 1
no i had to rebuild it because i reinstalled my operating system. i didn't know you could just install it into another directory.

i backed up the generic seeder directory though. i plugged in the old setting file and it fired up again. im not sure i have the settings completely correct though.

ive had it running with these settings for two week with no dump



i left the min_peer_proto_version blank and that gave me the error even though it is optional :/

do i want to use the RPC port or the P2P port for the port number?

also, my explorer_url and second_explorer_url are left blank so what should my block count be?


thanks for your help
jr. member
Activity: 43
Merit: 16
so,
i rebuilt it (which i probably should not have done) and now im getting this:

terminate called after throwing an instance of 'std::invalid_argument'
what():  stoi

btw... before i had been running the seeder for at least a week straight with nothing in the dump file but i think i had some settings in the configuration file wrong and i only had my cloudflare nameservers connected to my domain and not my subdomain. duh

Hard to say exactly what is going on there. It shouldn't let you rebuild unless the source code changed. Did you make any changes to the actual source code? If not, it seems that you might have a typo in the settings.conf file.

I would recommend restoring the original config file and try running the app to see if that gets you passed the error, and then restore your custom config file and try to figure out where you made the error by comparing the two files.

It should only take a minute or two for you to get a connection to your network, so if you don't start seeing the numbers going up right away, you likely have an incorrect setting for your network or no good seed nodes to gain entry. The cloudflare setup has absolutely nothing to do with connecting to the network, so even if you didn't fill out the cloudflare settings you should be able to get nodes in the dump file.

If all else fails, its pretty easy to just download the source again to a new directory and redo the steps to setup the app and try it again from scratch.
jr. member
Activity: 57
Merit: 1
so,
i rebuilt it (which i probably should not have done) and now im getting this:

terminate called after throwing an instance of 'std::invalid_argument'
what():  stoi

btw... before i had been running the seeder for at least a week straight with nothing in the dump file but i think i had some settings in the configuration file wrong and i only had my cloudflare nameservers connected to my domain and not my subdomain. duh
jr. member
Activity: 43
Merit: 16
step 10 is not working for me at all

running seeder.py gives me the following stderr

DEBUG:parser:Reading seeds dump file: /home/deusopus/generic-seeder/dnsseed.dump
Traceback (most recent call last):
  File "seeder.py", line 64, in
    main()
  File "seeder.py", line 25, in main
    seed_candidates = parser.read_seed_dump(os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + '/' + configuration['cf_seed_dump'].replace('"', ''), configuration['wallet_port'].replace('"', '')[:7].strip())
  File "/home/deusopus/generic-seeder/cf-uploader/parser.py", line 73, in read_seed_dump
    with open(seeds_file) as seeds:
FileNotFoundError: [Errno 2] No such file or directory: '/home/deusopus/generic-seeder/dnsseed.dump'

It seems you might be running through the steps pretty quickly. It takes a minute or two for the dump file to be created after you have started the seeder. Be patient and wait at least 1 minute first, then move on to Step 10 so that you can parse the good nodes that were found. I would actually recommend waiting a bit longer as well to be sure you are getting a better list, depending on how big your network is, it will take time to crawl all nodes.
jr. member
Activity: 57
Merit: 1
step 10 is not working for me at all

running seeder.py gives me the following stderr

DEBUG:parser:Reading seeds dump file: /home/deusopus/generic-seeder/dnsseed.dump
Traceback (most recent call last):
  File "seeder.py", line 64, in
    main()
  File "seeder.py", line 25, in main
    seed_candidates = parser.read_seed_dump(os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + '/' + configuration['cf_seed_dump'].replace('"', ''), configuration['wallet_port'].replace('"', '')[:7].strip())
  File "/home/deusopus/generic-seeder/cf-uploader/parser.py", line 73, in read_seed_dump
    with open(seeds_file) as seeds:
FileNotFoundError: [Errno 2] No such file or directory: '/home/deusopus/generic-seeder/dnsseed.dump'
jr. member
Activity: 43
Merit: 16
Not binding to IPv4 correctly. Have opened an issue at https://github.com/team-exor/generic-seeder/issues/5

In case you haven't seen it yet, I replied to your issue on github with some ideas for what might have gone wrong in your case. Still waiting for your reply to know if it was helpful or not. I've also updated the setup instructions with more details about the binding issues regarding Ubuntu along with multiple solutions.
full member
Activity: 312
Merit: 102
Not binding to IPv4 correctly. Have opened an issue at https://github.com/team-exor/generic-seeder/issues/5
jr. member
Activity: 43
Merit: 16
generic-seeder v1.1.0 has been released today.

Notable changes since last post on bitcointalk:

-Cloudflare mode now supports Python 3+ (Older python versions will no longer work)
-Added a new parameter option (-a, --address) that forces the seeder app to bind to a specific ip address for Local DNS Server mode
-Add app name + app version to startup msgs
-Various code improvements and stability fixes
  -Overwrite db services with version message results
  -Use distinct read and except sets in select()
  -Avoid strncpy for commands
  -Don't merge in re-rumours' nServices
  -Fix stack overflow in write_record_aaaa
  -Fix all known -Wvarargs, -Wreturn-type and -Wuninitialized warnings
  -Avoid strlen; use strnlen
-Improved readme and setup instructions
  -Updated readme layout format and verbiage improvements
  -Updated python3 cloudflare setup instructions
  -Updated non-root usage instructions (add new setcap method)

The full change log can be found here: https://raw.githubusercontent.com/team-exor/generic-seeder/master/CHANGELOG.

Special thanks to Irhel for providing the updated Python 3+ code.
jr. member
Activity: 43
Merit: 16
A small bug-fix for the generic-seeder was posted today. The bug would cause a segmentation fault error immediately upon starting the app when running in DNS server mode if built with certain versions of the dev tools. It is recommended to upgrade your seeders even if you weren't having troubles earlier to prevent future problems.

Special thanks to safecoin developer OleksandrBlack for bringing this issue to my attention.
sr. member
Activity: 1021
Merit: 324
This is super easy mode for setting up a dns seeder. Any coin devs that can't even do this should move onto other things.
jr. member
Activity: 43
Merit: 16
For anyone who might be following along, the generic-seeder was updated this weekend to add a few more options to the configuration:

  • init_proto_version (Required): This is the protocol version that should be used as a starting value to communicate with nodes on the blockchain. Ex: 209. Typically you can find the init protocol version in your coins version.h file.
  • min_peer_proto_version (Optional): This is the oldest/lowest protocol version that is allowed to communicate with nodes on the blockchain network. Ex: 70015. Typically you can find the minimum peer protocol version in your coins version.h file. Leave this value blank or set it to the same value as protocol_version if this setting does not exist in your blockchain.
  • caddr_time_version (Required): This is the nTime value that is used to serialize CAddress data for the blockchain. Ex: 31402. Typically you can find the caddr_time_version in your coins version.h file.

These changes remove more bitcoin-specific logic which can improve communication between seeder and nodes on your alt-coin's blockchain.
member
Activity: 250
Merit: 12
Support Guru
Fantastic guide, this should help out many of the altcoin projects who don't bother to run a seeder (pfft)  Cheesy

Although even with step by step instructions like this I'm sure there will still be many developers who don't bother to set this up.
jr. member
Activity: 43
Merit: 16
Thank you, does this guide work with other DNS providers?

Yes, there should be no issues using a domain from any provider. As long as you have the ability to create an NS and "A" record for the domain, you should be good to go.
jr. member
Activity: 42
Merit: 3
Thank you, does this guide work with other DNS providers?
jr. member
Activity: 43
Merit: 16
The following guide is my way of giving back to the greater crypto community for all the help and open-source code ideas that have been shared over the years. Before starting into the guide, it is important to note that this was written for use with the generic-seeder app, although many of the steps will still apply to other seeders based on the original bitcoin-seeder by Pieter Wuille.

What is the generic-seeder?

The generic-seeder is a clone of the original bitcoin-seeder app that aims to make it easy to run a seeder for virtually any bitcoin-based blockchain network. The bitcoin-seeder was developed specifically for the bitcoin network only, and configuring it to work with a different blockchain network can be time-consuming and tedious at best. The generic-seeder overcomes this limitation by utilizing a configuration file that holds the data used to connect to a given blockchain, without having to edit the source code.

A few additional features have been added to the generic-seeder as well:

  • CloudFlare DNS integration: An alternative method of using the seeder without utilizing the built-in DNS server found in the seeder app
  • Block explorer integration: Optionally provides more accurate detection of "good" nodes by comparing a given nodes block height against the block height reported from a trusted block explorer website api. Supports up to two block explorers. In the event the primary explorer goes down for any reason, or if the block count hasn't changed since the last check, the secondary explorer will be contacted as a backup
  • Force connections to IPv4 or IPv6 only if desired: Many blockchain networks are populated with nodes on either IPv4 or IPv6. There may be scenarios where one might want to find only the IPv4 nodes or only the IPv6 nodes on a blockchain network

OK, enough with the introductions. Let's jump right into the setup guide...

DNS Seeder Setup Guide:

The process of setting up a DNS seeder for use with a blockchain network includes two main components:

     1. DNS setup: This can be done using one of two methods: The original Local DNS Server Setup method or the newer Cloudflare Setup method.
     2. Application configuration: This involves searching through the source code for the target blockchain project you wish to run a DNS seeder for and plugging the correct values into a config file.

NOTE: If you would just like to crawl a particular blockchain network to get a list of all connectable nodes, you can skip the whole DNS Setup and need for purchasing a domain name and just configure the seeder app by following the Seeder App Configuration section only.

Local DNS Server Setup:

In this section you will learn how to create a basic DNS server using the DNS seeder app which listens for DNS requests and serves results based on the IP addresses that have been crawled on your blockchain network. The steps provided make use of a domain name purchased from https://namecheap.com which is just a sample of one of the many domain registrars that could be used to do this set up. You can alternatively skip this section and set up your DNS seeder using a free Cloudflare account by following the instructions in the Cloudflare Setup section.

Prerequisites

     1. You will need control of a top-level domain (TLD) that allows administrator access for the purposes of creating additional DNS entries. Any domain registrar should be OK to use. Ex: godaddy.com, register.com, hostgator.com, etc.

Detailed Local DNS Server Setup Instructions

     1. While it may be possible to use an existing domain for this set up, it is recommended to register a new domain name that will be used to run the DNS seeder address. A domain from https://namecheap.com will be used for this example.
     2. Log into your domain registrar and navigate to the section where you can manage DNS records for your domain. Locate the button or mechanism to create a new DNS record and click/activate it.

    

     3. Create a new DNS record using the following settings, and then save the record:

     Type: "A" Record
     Name/Host: (Any domain prefix can go here as long as you match it to the value from step 4. Ex: vps)
     Value: (The IP address of the server where your DNS seeder app will be running. Ex: 125.128.221.118)
     TTL: 24 Hours (86400) (If there is some kind of default option such as 'Automatic', you can select that instead)

    

     4. Create another new DNS record using the following settings, and then save the record:

     Type: NS Record
     Name/Host: (Any domain prefix can go here as long as you match it to the host value used in the Seeder App Configuration section. Ex: dnsseed)
     Value/Nameserver: (The fully qualified "A" record that was created in step 3. Ex: vps.example.com)
     TTL: 24 Hours (86400) (If there is some kind of default option such as 'Automatic', you can select that instead)

    

     NOTE: Do not worry about waiting for these DNS settings to propagate now, as they won't finish propagating until after the DNS seeder app is configured and running. The DNS seeder app will create a lightweight DNS server which will automatically connect the DNS entries together for you.

     5. That's it for the Local DNS Server Setup! You can now skip to the Seeder App Configuration section to finish the application installation.

Cloudflare Setup:

Instead of using the DNS seeder app to run your own DNS server, this section utilizes a free Cloudflare account to host the list of good nodes from your blockchain network. If you have already completed the Local DNS Server Setup then you can skip this section, as it is only an alternative method to accomplish a similar result.

Prerequisites

     1. You will need control of a top-level domain (TLD) that allows administrator access for the purposes of creating additional DNS entries and changing default nameservers. Any domain registrar should be OK to use. Ex: godaddy.com, register.com, hostgator.com, etc.

Detailed Cloudflare Instructions

     1. While it may be possible to use an existing domain for this set up, it is recommended to register a new domain name that will be used to run the DNS seeder address. A domain from https://namecheap.com will be used for this example.
     2. Navigate to https://dash.cloudflare.com/sign-up to create a new Cloudflare account. Enter your email address, set a new password, and click the "Create Account" button.

    

     3. Be sure to check your email and click the activation link to unlock your account.

    
    

     4. Continuing with the Cloudflare setup, it will ask you to add a site. Go ahead and enter the base domain name that you have purchased to set up for the seeder (Ex: example.com) and click the "Add Site" button.

    

     5. Choose the free plan, as there really isn't much benefit to choosing a paid plan for DNS seeder use. Click the "Confirm plan" button to continue.

    

     6. The "Review your DNS records" screen shows your existing DNS setup for your domain and can be skipped for now by clicking the "Continue" button.

    

     7. The final screen shows basic instructions for changing your existing nameservers over to Cloudflare servers. Be sure to complete the next step below before clicking the "Done, check nameservers" button.

    

     8. Log into your domain registrar website and update the nameservers for your DNS seeder domain (using namecheap.com as a sample registrar in this case - your domain registrar will have a similar but different screen for changing the nameservers).

    

     9. After updating your domains nameservers, you can click the "Done, check nameservers" button to return to the Cloudflare dashboard. You will need to wait for 1-48 hours for the propagation of the new nameservers to complete. An email will be sent to you from Cloudflare once they notice it is activated on their end, and you can also see a success msg in the Cloudflare dashboard once propagation has finished as well.

    
    

     10. That's it for the Cloudflare Setup! You can now move to the Seeder App Configuration section to finish the application installation.

Seeder App Configuration:

This section must be completed on a computer running the Linux operating system. Instructions for Debian/Ubuntu are provided below, but other Linux distros should be possible as long as boost and ssl are installed.

Prerequisites

     1. If you are going to be linking the DNS seeder app to a DNS entry, you must have already purchased a domain name and created the necessary DNS entries as described above.
     2. A Debian/Ubuntu server to host the DNS seeder app.
     3. If you are using the Local DNS Server Setup then you must either run the seeder app with root privileges, or else there will be an extra step to redirect the internal port number.

Detailed Seeder App Instructions

     1. Install the dependencies for the DNS seeder app by running the following cmd in the terminal:
Code:
sudo apt-get install build-essential libboost-all-dev libssl-dev libcurl4-openssl-dev libconfig++-dev

     2. ONLY COMPLETE THIS STEP IF YOU ARE SETTING UP THE SEEDER FOR USE WITH CLOUDFLARE, OTHERWISE YOU MAY SKIP THIS STEP.

     Extra setup is required before CloudFlare mode will work properly. Python 3+ and the Cloudflare Python API must be installed. Run the following cmds in the terminal, one line at a time:

Code:
sudo apt-get install python3 python3-pip
sudo pip3 install cloudflare

     3. Download the latest copy of the generic DNS seeder app by running the following cmd in the terminal:
Code:
git clone https://github.com/team-exor/generic-seeder.git

     4. Navigate to the newly downloaded DNS seeder app directory by running the following cmd in the terminal:
Code:
cd generic-seeder

     5. Create a default configuration file by running the following cmd in the terminal:
Code:
cp ./settings.conf.template ./settings.conf

     6. Open the configuration file using the nano editor by running the following cmd in the terminal:
Code:
nano settings.conf

     7. Using the arrow keys on the keyboard to move around, fill in all the necessary values in the configuration file and press CTRL+X, then Y (for yes to save) and then ENTER to save the changes to the config. NOTE: All config values must be surrounded by double-quotes or else the configuration will be deemed invalid.

Extra details about each specific config settings:

  • protocol_version (Required): This is the current protocol version that should be used by the seeder app to crawl your network and connect to other nodes. Ex: 70015. Typically you can find the protocol version in your coins version.h file.
  • init_proto_version (Required): This is the protocol version that should be used as a starting value to communicate with nodes on the blockchain. Ex: 209. Typically you can find the init protocol version in your coins version.h file.
  • min_peer_proto_version (Optional): This is the oldest/lowest protocol version that is allowed to communicate with nodes on the blockchain network. Ex: 70015. Typically you can find the minimum peer protocol version in your coins version.h file. Leave this value blank or set it to the same value as protocol_version if this setting does not exist in your blockchain.
  • caddr_time_version (Optional): This is the nTime value that is used to serialize CAddress data for the blockchain. Ex: 31402. No longer used by bitcoin and some other modern cryptocurrencies. Set to blank "" or 0 if not used for your blockchain. Typically you can find the caddr_time_version in your coins version.h file if it exists.
  • pchMessageStart_0 (Required): The first byte of the "magic bytes" that are unique to the blockchain you are configuring. Must be prefixed with 0x followed by the two digits to make up the full byte. Ex: 0x11. Typically you can find the 4 pchMessageStart values in your coins main.cpp or chainparams.cpp file.
  • pchMessageStart_1 (Required): The second byte of the "magic bytes" that are unique to the blockchain you are configuring. Must be prefixed with 0x followed by the two digits to make up the full byte. Ex: 0x22. Typically you can find the 4 pchMessageStart values in your coins main.cpp or chainparams.cpp file.
  • pchMessageStart_2 (Required): The third byte of the "magic bytes" that are unique to the blockchain you are configuring. Must be prefixed with 0x followed by the two digits to make up the full byte. Ex: 0x33. Typically you can find the 4 pchMessageStart values in your coins main.cpp or chainparams.cpp file.
  • pchMessageStart_3 (Required): The fourth byte of the "magic bytes" that are unique to the blockchain you are configuring. Must be prefixed with 0x followed by the two digits to make up the full byte. Ex: 0x44. Typically you can find the 4 pchMessageStart values in your coins main.cpp or chainparams.cpp file.
  • wallet_port (Required): The main port # that is used to connect to the wallets in your blockchain. Ex: 12345. This is NOT the rpc port #.
  • explorer_url (Optional): The url to a block explorer api that returns the current block height for your blockchain. Ex: https://explorer.example.com/api/getblockcount. If this value is set to a valid block explorer api url, then the current block is fetched from the block explorer api once every x seconds based on the explorer_requery_seconds value. Leaving this value blank will cause nodes to be validated against the hardcoded block_count number below to determine whether a node is considered "good" or not based on if the nodes current block is above or below the currently known block height value.
  • second_explorer_url (Optional): An alternate url to a block explorer api that returns the current block height for your blockchain. If both explorer_url and second_explorer_url are set to valid block explorer api urls, then the 1st explorer_url will be contacted. If for any reason the 1st api does not return a valid block count, or if the block count hasn't changed since the last check, then the 2nd explorer url is used as a backup.
  • explorer_requery_seconds (Required only if explorer_url or second_explorer_url is set): Used in conjunction with the explorer_url and second_explorer_url parameters. This represents the total amount of time to wait in seconds before re-getting the current block height value from the block explorer api url. Typically it is recommended to set this value to the average amount of seconds that your blockchain takes to find a new block.
  • block_count (Required): This value represents the lowest block height that will be allowed for any node to be considered a "good" node. If either the explorer_url or second_explorer_url options are set, then this block_count value will be continuously reset to the value returned from the last contacted explorer api.
  • seed_1 (Required): The 1st hardcoded ip address or domain to connect to. Because blockchains are decentralized, providing the address to a single node on the network is required here for gaining access to more peers on the blockchain. This can simply be an IP address of any node on the blockchain network that you are trying to crawl, or it can be the address to another DNS seeder instance that will return multiple node addresses.
  • seed_2 (Optional): The 2nd hardcoded ip address or domain to connect to. This is optional because only one seed node address is required to gain access to the whole blockchain.
  • seed_3 (Optional): The 3rd hardcoded ip address or domain to connect to. This is optional because only one seed node address is required to gain access to the whole blockchain.
  • seed_4 (Optional): The 4th hardcoded ip address or domain to connect to. This is optional because only one seed node address is required to gain access to the whole blockchain.
  • seed_5 (Optional): The 5th hardcoded ip address or domain to connect to. This is optional because only one seed node address is required to gain access to the whole blockchain.
  • seed_6 (Optional): The 6th hardcoded ip address or domain to connect to. This is optional because only one seed node address is required to gain access to the whole blockchain.
  • seed_7 (Optional): The 7th hardcoded ip address or domain to connect to. This is optional because only one seed node address is required to gain access to the whole blockchain.
  • seed_8 (Optional): The 8th hardcoded ip address or domain to connect to. This is optional because only one seed node address is required to gain access to the whole blockchain.
  • seed_9 (Optional): The 9th hardcoded ip address or domain to connect to. This is optional because only one seed node address is required to gain access to the whole blockchain.
  • seed_10 (Optional): The 10th hardcoded ip address or domain to connect to. This is optional because only one seed node address is required to gain access to the whole blockchain.
  • cf_domain (Optional): The domain name that you want to configure for use with Cloudflare and the DNS seeder app. Ex: example.com. This value is only required if you followed the Cloudflare Setup.
  • cf_domain_prefix (Optional): The domain name prefix for the NS record that is configured for use with Cloudflare and the DNS seeder app. Ex: dnsseed. This value is only required if you followed the Cloudflare Setup.
  • cf_username (Optional): The username (usually an email address) for the Cloudflare account that is configured for use with the DNS seeder app. Ex: [email protected]. This value is only required if you followed the Cloudflare Setup.
  • cf_api_key (Optional): The API key for the Cloudflare account that is configured for use with the DNS seeder app. You can find this value by logging into your Cloudflare account, clicking on the domain you have configured for the DNS seeder, ensure you are on the Overview tab and scroll down to find and click on a link called "Get your API token". Open the "API Tokens" tab, then click the "View" button next to the "Global API Key" and enter your password to gain access to your API key. Ex: 4f387a3b17d9efde484951fb372dbcb2. This value is only required if you followed the Cloudflare Setup.
  • cf_seed_dump (Optional): The name of the dump file with the list of "good" nodes that the Cloudflare script should look for. For now, this should always be set to dnsseed.dump, but may need to be changed in the future for more advanced setups. This value is only required if you followed the Cloudflare Setup.

     8. Compile the DNS seeder app by running the following cmd in the terminal:
Code:
make

     9. At this point everything should be ready to run the DNS seeder app. If you followed the Cloudflare Setup or if you would just like to crawl the blockchain network to get a list of all connectable nodes, you can run the DNS seeder app without any arguments like this:
Code:
./dnsseed

     If you followed the Local DNS Server Setup then you must additionally run the app with root privileges, and specify a few extra arguments like this:
Code:
sudo ./dnsseed -h dnsseed.example.com -n vps.example.com -m [email protected]

     dnsseed.example.com (Required): the NS record that you created in step 4 of the Local DNS Server Setup.
     vps.example.com (Required): the "A" record that you created in step 3 of the Local DNS Server Setup.
     [email protected] (Optional): the email address that the DNS server will use to report SOA records.

     NOTE 1: If using the Local DNS Server Setup method, port 53 must be open and available to the public internet for this process to work properly. If you are behind a firewall, you will need to open port 53 before your DNS seeder will properly respond to DNS requests. If you are already running another DNS server or some other application is already using port 53, you will need to run this software on another server.

     NOTE 2: If using the Local DNS Server Setup method, and you are unable to always run the DNS seeder app with root privileges, you can skip to step 11 for an alternate method that requires root privileges one time only.



     SPECIAL INSTRUCTIONS FOR UBUNTU USERS

     All Ubuntu releases starting with 16.10 (first released in October 2016) come installed with systemd-resolved, which effectively prevents the seeder's built-in DNS server from working correctly. This is due to both applications requiring use of port 53, and systemd-resolved takes priority by default. There are a few ways to resolve this issue:

          1. Force the seeder to bind to a specific IP address by adding the following argument to the terminal cmd: -a . This is the recommended solution as it doesn't require disabling of any operating system services.

          Example:

Code:
sudo ./dnsseed -h dnsseed.example.com -n vps.example.com -a 123.231.123.231

          2. Disable binding of systemd-resolved to port 53 by editing the /etc/systemd/resolved.conf file and adding this line to the bottom of the file:

Code:
DNSStubListener=no

          Save and reboot, and now systemd-resolved will no longer interfere with the seeder's DNS server.

          NOTE: This method is only supported by systemd 232 and newer. You can check your version of systemd with the cmd: systemctl --version

          3. Completely disable the systemd-resolved service with the following cmds (not recommended as it may cause undesired side-effects if you use the same server for anything other than running the seeder app):

Code:
sudo systemctl disable systemd-resolved
sudo systemctl stop systemd-resolved



     10. ONLY COMPLETE THIS STEP IF YOU ARE SETTING UP THE SEEDER FOR USE WITH CLOUDFLARE, OTHERWISE YOU MAY SKIP THIS STEP.

     An extra step is required for taking the "good" list of nodes from the DNS seeder app and sending it to Cloudflare. To do this manually you can run the following cmd in the terminal:
Code:
cd /path/to/seeder/cf-uploader && python3 seeder.py

     Change /path/to/seeder/ so that it matches the location of where you installed the DNS Seeder app. After running this cmd, if everything went well and is working, you should be able to immediately run the following cmd in a terminal window and see results (Be sure to change dnsseed.example.com to your fully qualified NS record):
Code:
nslookup dnsseed.example.com

     The IP addresses that are returned from the nslookup cmd are coming from your dnsseed.dump file, so you can always double-check by cross-referencing some of the IP addresses in both places.

     Once you are sure that everything is working, it is recommended to set up a cron job that will automatically update the seeds list every 30 minutes or so by running the following cmd in a terminal:
Code:
crontab -e

     Then add this line to the bottom of the crontab file that opens up (Be sure to change the /path/to/seeder/ part so it matches the location of where you installed the DNS Seeder app):
Code:
*/30 * * * * cd /path/to/seeder/cf-uploader && python3 seeder.py

     11. ONLY COMPLETE THIS STEP IF YOU ARE SETTING UP THE SEEDER USING THE LOCAL DNS SERVER SETUP METHOD AND DO NOT WANT TO ALWAYS HAVE TO RUN THE SEEDER APP AS THE ROOT USER, OTHERWISE YOU MAY SKIP THIS STEP.

     Because non-root users cannot access ports below 1024, an extra step is required to allow you to run the DNS server (which must always use port 53) without root privileges. There are two known workaround methods that both require a one-time command be executed as root:
          i. The first method is to use the setcap command to change the capabilities of the dnsseed binary file to specifically allow the app to bind to a port less than 1024 (this one-time cmd requires root privileges to execute successfully):
Code:
sudo setcap 'cap_net_bind_service=+ep' /path/to/dnsseed

          Once the setcap command is complete, you can start the seeder app as per normal, without the need for sudo:
Code:
./dnsseed -h dnsseed.example.com -n vps.example.com -m [email protected]

          ii. The second method is to add a redirect entry for port 53 in the iptables firewall system before running the seeder app as a non-root user by running the following cmd in the terminal (this one-time cmd requires root privileges to execute successfully):
Code:
sudo iptables -t nat -A PREROUTING -p udp --dport 53 -j REDIRECT --to-port 15353

          Now, when starting the DNS seeder app, you must always specify the redirected port using the -p argument:
Code:
./dnsseed -h dnsseed.example.com -n vps.example.com -m [email protected] -p 15353

          NOTE: The redirected port 15353 must be open and available to the public internet for this process to work properly. If you are behind a firewall, you will need to open port 15353 before your DNS seeder will properly respond to DNS requests.

     12. That's it for the Seeder App Configuration! Be sure to read the extra troubleshooting notes below if you have any problems.

Tips & Troubleshooting:

  • While running the DNS seeder app, the total "good" nodes vs total nodes will increase as more nodes are found. If after a few minutes your seeder app is still showing 0/x available then most likely you have a configuration problem and are not properly connected to the chosen blockchain network. Stop the app with CTRL+C and double-check your settings with nano settings.conf and try again.
  • After running the DNS seeder app for a few minutes, a dnsseed.dump file will be created in the same directory as the seeder app. If you open this file using a text editor, you will see a list of all nodes that the seeder app has crawled along with stats about their status, uptime, current block, etc. Only the IP addresses of "good" nodes will be shared back to your DNS server, so be sure to look at the "good" column value (1 = good, 0 = bad). You can always check the dnsseed.dump file for an updated look at how many nodes are on your blockchain network and the status of each.
  • If everything is working correctly, you can see a list of "good" IP addresses by running the cmd nslookup dnsseed.example.com (Replace dnsseed.example.com with your NS record). Please keep in mind that these results can be cached, and even after everything is working you may still continue seeing the same invalid results. You can always try testing from multiple computers or else you can use an online service such as https://www.whatsmydns.net/#A/dnsseed.example.com for example.


  • If using Ubuntu and you aren't able to get the local DNS server method to return any "good" IP addresses via nslookup, try restarting the seeder and additionally supplying the -a argument to force the seeder to bind to a specific IP address.

Useful Links:

original DNS seeder setup guide: https://github.com/team-exor/generic-seeder/blob/master/SETUP.md
generic-seeder github: https://github.com/team-exor/generic-seeder
bitcoin-seeder github: https://github.com/sipa/bitcoin-seeder
Jump to: