Pages:
Author

Topic: A Basic Guide/Tutorial for Creating DNS Seeders (Read 7086 times)

jr. member
Activity: 43
Merit: 16
I would like to say a BIG THANK YOU to the original creator of this thread @PereguineBerty, as this has served as the main setup guide for the bitcoin-seeder for exactly 6 years to the day!

A lot has changed since then, and earlier this year I took it upon myself to improve the functionality of the seeder app and also took the time to write a complete step-by-step guide for its use.

All details, including a copy of the full guide can be found here: https://bitcointalksearch.org/topic/dns-seeder-setup-guide-using-the-generic-seeder-5239304
jr. member
Activity: 43
Merit: 16
Hi,
I'm trying to setup bitcoin seeder, but i'm having problem with correct DNS setup.

Domain is registered in Goddady, and i have DNS record:

Code:
NS               @                   ns1.seederio.com          1h

VPS in Vultr, with IPv6 and reverse DNS

Code:
xxxxxxxxxxxxxxxxxxxxxxxxxxx ns1.seederio.com


Command to run seeder (with root priv):
Code:
./dnsseed -h seederio.com -n ns1.seederio.com -m [email protected] -t 2 -d 1


But after command:
Code:
dig -t A ns1.seederio.com

I've got following message:

Code:
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ns1.seederio.com.              IN      A

;; AUTHORITY SECTION:
seederio.com.           600     IN      SOA     ns13.domaincontrol.com. dns.jomax.net. 2019123003 28800 7200 604800 600

;; Query time: 217 msec
;; SERVER: 62.179.1.61#53(62.179.1.61)
;; WHEN: Mon Dec 30 13:15:17 CET 2019
;; MSG SIZE  rcvd: 116

For
Code:
dig -t NS ns1.seederio.com
I've got the same result. Could you help me with this problem?

You are missing some steps in your DNS setup.

First of all, you are required to create both an NS and "A" record, and it looks like you have only created an NS record (and even that I don't think is true because you seem to be trying to use your domains default ns1 nameserver). Next, your NS record must point to the "A" record, and your "A" record must point to the ip address of your vps. And lastly, your arguments for running the seeder app are mixed up a bit.

To correct your current setup I would do something like this:

1) Create an "A" record that points to the ip address for your vps (ex: 111.222.123.231). You can give it any name you want but for this example lets call it vps.seederio.com
2) Create a new NS record and point it to the "A" record you just created. The NS record can also be called whatever you want but for this example lets call it seeder.seederio.com
3) On your vps, setup the DNS seeder app according to the instructions (I believe you already did this step)
4) Run the following cmd on the vps to start crawling your coins network and simultaneously start listening for DNS requests:

Code:
./dnsseed -h seeder.seederio.com -n vps.seederio.com -m email.example.com

5) Wait a few minutes to allow the seeder to find the "good" nodes on your network.
6) You can test that your seeder is working by using the following cmd, but keep in mind that these values can be cached and may not always give a good result even if it is working:

Code:
nslookup seeder.seederio.com

If all is working it should return a list of "good" ip addresses that are valid seed nodes for your network. An alternative to using the nslookup cmd is to use an online service to check if your seeder is working. You can visit this page after your seeder is running to see if it is working (you should see lots of ip addresses and green checkmarks. Seeing no ip addresses and red X's means something isnt working): https://www.whatsmydns.net/#A/seeder.seederio.com

7) That's it! You are done!  Smiley
newbie
Activity: 3
Merit: 0
I got it working on my end by using a subdomain so something like this:

Code:
A ns 111.222.333.444 1h
NS seeder ns.seederio.com 1h

dnsseed -h seeder.seederio.com -n ns.seederio.com -m [email protected]

dig seeder.seederio.com

;; ANSWER SECTION:
seeder.seederio.com. 3600 IN A 111.222.333.444
111.222.333.445
111.222.333.446



Still no result. When i put
Code:
dig +trace @8.8.8.8 seeder.seederio.com any
I've got:
Code:
;; Connection to 2001:41d0:xxxxxxxx#53(2001:41d0:xxxxxx) for seeder.seederio.com failed: connection refused.

Seeder is working on port 53. UFW is disable


Code:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1479/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      1479/sshd
udp        0      0 0.0.0.0:68              0.0.0.0:*                           1108/dhclient
udp6       0      0 :::53                   :::*                                10929/dnsseed
root@vps790584:~/seeder# sudo lsof -i -P -n | grep LISTEN
sshd      1479 root    3u  IPv4  14942      0t0  TCP *:22 (LISTEN)
sshd      1479 root    4u  IPv6  14951      0t0  TCP *:22 (LISTEN)
member
Activity: 250
Merit: 12
Support Guru
I got it working on my end by using a subdomain so something like this:

Code:
A ns 111.222.333.444 1h
NS seeder ns.seederio.com 1h

dnsseed -h seeder.seederio.com -n ns.seederio.com -m [email protected]

dig seeder.seederio.com

;; ANSWER SECTION:
seeder.seederio.com. 3600 IN A 111.222.333.444
111.222.333.445
111.222.333.446


newbie
Activity: 3
Merit: 0
Hi,
I'm trying to setup bitcoin seeder, but i'm having problem with correct DNS setup.

Domain is registered in Goddady, and i have DNS record:

Code:
NS               @                   ns1.seederio.com          1h

VPS in Vultr, with IPv6 and reverse DNS

Code:
xxxxxxxxxxxxxxxxxxxxxxxxxxx ns1.seederio.com


Command to run seeder (with root priv):
Code:
./dnsseed -h seederio.com -n ns1.seederio.com -m [email protected] -t 2 -d 1


But after command:
Code:
dig -t A ns1.seederio.com

I've got following message:

Code:
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ns1.seederio.com.              IN      A

;; AUTHORITY SECTION:
seederio.com.           600     IN      SOA     ns13.domaincontrol.com. dns.jomax.net. 2019123003 28800 7200 604800 600

;; Query time: 217 msec
;; SERVER: 62.179.1.61#53(62.179.1.61)
;; WHEN: Mon Dec 30 13:15:17 CET 2019
;; MSG SIZE  rcvd: 116

For
Code:
dig -t NS ns1.seederio.com
I've got the same result. Could you help me with this problem?
member
Activity: 250
Merit: 12
Support Guru
I believe clientVersion is the protocol version - I believe the seeder is only saving the "protocolversion" from the nodes it connects to and does not do anything with the "version" (i.e. from -getinfo)

If you check you'll see that clientVersion doesn't get overwritten with a different value for each if statement so it will always contain the protocol version.
newbie
Activity: 2
Merit: 0
The variable "clientVersion" is compared with REQUIRE_VERSION(which is a protocol version) in the function IsGood,
Code:
if (clientVersion && clientVersion < REQUIRE_VERSION) return false;
while it is compared with 31900(which seems to be a client version v0.3.19) in the function GetBanTime.
Code:
if (clientVersion && clientVersion < 31900) { return 604800; }
What on earth should "clientVersion" be compared with? Client version or protocol version?
newbie
Activity: 3
Merit: 0
Hey guys,

I've been trying to get a bitcoin-seeder working myself, but i keep getting stuck trying to set up a nameserver..

The things i have:
1. VPS where i want to run the dnsseed on (12.345.678.90)
2. Sub-domain (seed.example.com)
3. Sub-domain2 (ns0.example.com)

The steps i took are:
1. Go to the subdomain seed.example.com and go to DNS settings.
2. Select NS-record and put "ns0.example.com" in it
3. Go to sub-domain "ns0.example.com" and put a A-record with the VPS ip "12.345.678.90"

When i run "dig -t NS seed.example.com"  i get an servfail and it wont show anything:
Code:
dig -t NS seed.helix-crypto.com

; <<>> DiG 9.10.3-P4-Ubuntu <<>> -t NS seed.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 11513
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; MBZ: 0005 , udp: 4096
;; QUESTION SECTION:
;seed.example.com. IN NS

;; Query time: 38 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Fri Dec 14 09:55:51 PST 2018
;; MSG SIZE  rcvd: 50

When i run "dig -t A ns0.example.com" i do get the A record forwarding to the VPS IP:
Code:
dig -t A ns0.helix-crypto.com

; <<>> DiG 9.10.3-P4-Ubuntu <<>> -t A ns0.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10330
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; MBZ: 0005 , udp: 4096
;; QUESTION SECTION:
;ns0.example.com. IN A

;; ANSWER SECTION:
ns0.example.com. 5 IN A 12.345.678.90

;; Query time: 36 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Fri Dec 14 11:15:54 PST 2018
;; MSG SIZE  rcvd: 65

When i try to run the dnsseed program it wont find my any seeds either this way:
./dnsseed -h seed.example.com -n ns0.example.com -p 5353
https://i.gyazo.com/f2b52ec55e1b8d6ce3737e08feb47a5f.png

When i go back to the sub-domain seed.example.com and remove the NS record and change it with a A record directly to the VPS i get:
Code:
dig -t NS seed.example.com

; <<>> DiG 9.10.3-P4-Ubuntu <<>> -t NS seed.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58593
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; MBZ: 0005 , udp: 4096
;; QUESTION SECTION:
;seed.example.com. IN NS

;; AUTHORITY SECTION:
example.com. 5 IN SOA shades19.rzone.de. hostmaster.strato-rz.de. 2018121404 86400 7200 604800 7200

;; Query time: 36 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Fri Dec 14 11:20:26 PST 2018
;; MSG SIZE  rcvd: 124

And when i run dnsseed with the following parameters it does find seeds, but it wont broadcast them to the dns:
./dnsseed -h seed.example.com -n 12.345.678.90 -p 5353
https://i.gyazo.com/04db23b1de72e8080aa45ceb15e1d2fc.png


It seems like whatever i try, i keep getting servfail when i set a NS to anything. Does anyone have any clue what i'm doing wrong and what i should change to get it working?
full member
Activity: 315
Merit: 102
I'm a little confused as to how one customizes the seeder software itself so that it crawls a specified altcoin on a specified port.  Is there anywhere the shows what you have to customize so that the seeder is crawling the proper network?

The OP, PereguineBerty's Guide is very useful, but could use some copy-editing.

Start with the latest source code, (from the original author, SIPA (Peter Wuille), as written for bitcoin)
Code:
git clone https://github.com/sipa/bitcoin-seeder.git
   and   change things specific to your coin.

You can compare what we've done for Bitmark:
https://github.com/sipa/bitcoin-seeder/compare/master...project-bitmark:master

Basically, you should customize which node versions your seeder will report as good, the required blockheight, the protocol version, the fixed seed nodes your seeder needs to get started, the "magic" bytes of pchMessageStart[] and of course, the P2P port for your coin.

PM me if you need more help.

Thats' looks very helpful, but still not able to have anything working Cheesy
Just pm'ed you!
newbie
Activity: 22
Merit: 2
You can also make a systemd service.

nano /etc/systemd/system/seed.service

put this in, customize where needed:

[Unit]
Description=COIN dns seeder
After=network.target

[Service]
WorkingDirectory=//coin-seeder
ExecStart=//coin-seeder/dnsseed -h -n -m [email protected]
Restart=on-failure
RestartSec=10
User=root
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=COIN-seeder

[Install]
WantedBy=multi-user.target

save & exit
systemctl daemon-reload
systemctl enable seed
systemctl start seed
newbie
Activity: 6
Merit: 1
Can anyone tell me how to run dns seeder as service on ubuntu? I want to be sure that my dns seeder is automatically running after server reboot

crontab is your friend  Wink

sudo crontab -e # You're starting the seeder as root

Then add the line : @reboot // [-]

That should do it.
full member
Activity: 484
Merit: 104
I'm a little confused as to how one customizes the seeder software itself so that it crawls a specified altcoin on a specified port.  Is there anywhere the shows what you have to customize so that the seeder is crawling the proper network?

The OP, PereguineBerty's Guide is very useful, but could use some copy-editing.

Start with the latest source code, (from the original author, SIPA (Peter Wuille), as written for bitcoin)
Code:
git clone https://github.com/sipa/bitcoin-seeder.git
   and   change things specific to your coin.

You can compare what we've done for Bitmark:
https://github.com/sipa/bitcoin-seeder/compare/master...project-bitmark:master

Basically, you should customize which node versions your seeder will report as good, the required blockheight, the protocol version, the fixed seed nodes your seeder needs to get started, the "magic" bytes of pchMessageStart[] and of course, the P2P port for your coin.

PM me if you need more help.
full member
Activity: 484
Merit: 104
Can anyone tell me how to run dns seeder as service on ubuntu? I want to be sure that my dns seeder is automatically running after server reboot

What version of Ubuntu are you running ?  

On Ubuntu 14.04 LTS & 16.04 LTS, run DNS seeder via /etc/rc.local
I ilke to start a detached screen session, (called seeder-screen) everytime on boot.

(Note: on Ubuntu 18.04 LTS, systemd has eliminated /etc/rc.local setups. In this OS, you can set up a systemd unit file in /etc/systemd/system, but it's not possible to pass parameters via the 'ExecStart' spec, so the binary should be hardcoded with your particular parameters, such as name of sub-domain served and the hosting IP address, etc.)


example:
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.


### Bitmark DNS Seeder - Answers with ip-addresses in the da.bitmark.guru sub-domain    
###           which are all running know-good bitmark nodes                                                
screen -dmS seeder-screen dnsseed -h da.bitmark.guru -n 204.68.122.22 -m [email protected]

You can check functioning of the seeder by attaching to the seeder-screen session.

Code:
screen -dr seeder-screen

Code:
Bitmark (MARKS) DNS Seeder
Supporting whitelisted filters: 0x1,0x5,0x9,0xd
Starting 4 DNS threads for da.bitmark.guru on 204.68.122.22 (port 53).......done
Starting seeder...done
[18-09-16 14:34:42] 36/296 available (264 tried in 1000s, 0 new, 32 active), 307 banned; 3445 DNS requests, 3332 db querie
newbie
Activity: 68
Merit: 0
I'm a little confused as to how one customizes the seeder software itself so that it crawls a specified altcoin on a specified port.  Is there anywhere the shows what you have to customize so that the seeder is crawling the proper network?
full member
Activity: 462
Merit: 105
Can anyone tell me how to run dns seeder as service on ubuntu? I want to be sure that my dns seeder is automatically running after server reboot
newbie
Activity: 57
Merit: 0
Recently I face a similar problem and find this other useful doc in dogecoin seeder code:

Code:
./dnsseed -h dnsseed.example.com -n vps.example.com

That means your domain needs to be able to have arbitrary NS entries
for subdomains. Alternatively, if you want to use the apex domain as seed address,
you can just point this domains NS entry to the server where the seeder is running.

To help understand the NS settings, the request process works like this:
1. The client sends an A request to his DNS Server for dnsseed.example.com.
2. His DNS server goes up the DNS chain and finds which DNS server knows this address.
3. The authorative server for example.com tells us that vps.example.com is the NS server for dnsseed.example.com.
4. The A request gets send to vps.example.com.
5. dogecoin-seeder takes this request and returns a set of IPs back to the client.

So in short: Set an NS record on dnssseed.example.com pointing to whereever the
dogecoin-seeder is running. Make sure the address you put in there
(vps.example.com) points to this server. Run dogecoin-seeder with the above parameters.

If all goes right, a query to dnsseed.example.com should
report several IP addresses as A records. Note that it might take a few hours
for DNS settings to propagate over the internet.

If you want the DNS server to report SOA records, please provide an
e-mailadres (with the @ part replaced by .) using -m.
member
Activity: 109
Merit: 35
If you have a server running a form of *nix you can install and setup bind9. That way all you have to do is add some nodes to your zone file. No need to use bitcoin seeder.

Of course this will require manually updating your zone file to add new nodes.

Good guide otherwise.

Awesome stuff, thanks for posting this. How can one check to see if it works? Are there any stats that can be read either from the directory or by sending commands to the process?

Easy way to test is to use a site like https://www.whatsmydns.net and search the A record. If its working it should display a list of your peers/nodes or you can use 'dig' if on a *nix machine.

Thanks, esotericizm - yours is an interesting approach to seeder setup and may be an alternative for people who have difficulties with the Sipa seeder.

member
Activity: 109
Merit: 35
Awesome stuff, thanks for posting this. How can one check to see if it works? Are there any stats that can be read either from the directory or by sending commands to the process?

When the seeder is initialy run, it displays a real-time update of the stats of connected peers although the info it provides isn't always 100% reliable (at least not in my experience).

I find the best way is to check if it's working is by running your wallet, making sure that no nodes are available in yourcoin.config file. If the wallet doesn't pick up any new connections after a few seconds (but give it a minute or two to test), something isn't configured correctly.


Return 0 when on testnet and return 470000 when on mainnet, I guess, but what does in control exactly? Trying to adapt this for another coin and I don't quite understand this part.


Nodes that have blocks less than that number are
discarded by the crawler as not good candidates,
see IsGood db.h:108

Excellent answer, Yarkol. This will be added to the instructions.

Most of the important changes needed are included in the git commit history mentioned above and also in the seeder instructions but this one hasn't been mentioned. It could cause a real pain for devs if the seeder starts kicking nodes at specific blocks, so they should be made aware of this.
hero member
Activity: 750
Merit: 500
If you have a server running a form of *nix you can install and setup bind9. That way all you have to do is add some nodes to your zone file. No need to use bitcoin seeder.

Of course this will require manually updating your zone file to add new nodes.

Good guide otherwise.

Awesome stuff, thanks for posting this. How can one check to see if it works? Are there any stats that can be read either from the directory or by sending commands to the process?

Easy way to test is to use a site like https://www.whatsmydns.net and search the A record. If its working it should display a list of your peers/nodes or you can use 'dig' if on a *nix machine.
legendary
Activity: 996
Merit: 1013

Return 0 when on testnet and return 470000 when on mainnet, I guess, but what does in control exactly? Trying to adapt this for another coin and I don't quite understand this part.


Nodes that have blocks less than that number are
discarded by the crawler as not good candidates,
see IsGood db.h:108
Pages:
Jump to: