Bitcoin Forum
April 26, 2024, 04:16:02 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: A Basic Guide/Tutorial for Creating DNS Seeders  (Read 7082 times)
PereguineBerty (OP)
Member
**
Offline Offline

Activity: 109
Merit: 35


View Profile
May 07, 2014, 07:03:56 PM
Last edit: May 15, 2014, 06:27:29 PM by PereguineBerty
Merited by ABCbits (23)
 #1

These can be a serious pain in the ass to get working and let’s face it – the information available on them is rather fragmented and vague at best, even if you are already accustomed to the workings of currencies.

This guide is divided into three parts:
1)   Adapting the seeder software
2)   The web stuff
3)   Running the seeder

Before doing anything else, it would be best to have a web address in mind for your seeder. Most of them use subdomains i.e. dnsseed.yourcoin.org rather than regular page links such as yourcoin.org/dnsseed (this is for DNS record reasons). You don’t have to call yours dnsseed; in fact you can call it what the hell you like.

Adapting the Software
1.1)  In your currency’s net.cpp enter the address that will be used for your seeder i.e.

Code:
static const char *strMainNetDNSSeed[][2] = {
{"yourcoin.org", " dnsseed.yourcoin.org "},
        {NULL, NULL}
}

You will need to recompile all your wallets before release for these changes to take effect, so make sure you settle for something that won’t need to be changed later.

1.2)  Download or make a fork of the Litecoin Seeder https://github.com/pooler/litecoin-seeder which is based on sipa’s Bitcoin Seeder https://github.com/sipa/bitcoin-seeder). You can use either version and it doesn’t matter whether your coin is SHA-256, Scrypt, X-11 etc. The LTC version is used here for demonstration purposes because it has already been customized and the most relevant/important stuff has already been changed. This means there’s commit history and it’s much easier to show changes using GitHub as it has color coded syntax highlighting - which isn’t possible on this forum. Whichever version you use, read the README to familiarize yourself with the process.

1.3)  Using this Litecoin Seeder historical commit as a reference: https://github.com/pooler/litecoin-seeder/commit/3c64ed5ab35f597480712818a27d442100332719#diff-4ed1bfdfd26731997cfdb6c1085c6692, you need to alter your own seeder code with  your coin’s ports, magic bytes (pchMessageStart stuff), protocol version, seeder name and the web address of your of your DNS seed.

Note:  When adding your domain name in the seeder’s main.cpp, if you only have one site to enter, use the following syntax in full:

Code:
static const string mainnet_seeds[] = {"dnsseed.yourcoin.org", ""};

Otherwise you will get segmentation faults when compiling later.

1.4)  Upload your repo to GitHub.


The Web Stuff
The main point of this stage is to (very loosely put it) redirect traffic from your website by creating a DNS 'NS Record' and an 'A record' to instruct where the resources can be found. This will enable your web address to forward to a host somewhere else, such as a VPS running the DNS Seeder software.

2.1) In your website host’s admin panel website, create a subdomain. If you are self-hosting you probably might not need to create a subdomain and can just use DNS records to achieve the desired result. Use the address entered in your currency’s main.cpp i.e dnsseed.yourcoin.org. Web host admin panels vary tremendously, so you may need to Google how to do this on yours. This link has useful info on creating an NS record http://help.dnsmadeeasy.com/spry_menu/ns-record/

You might need to do this twice – once for dnsseed.yourcoin.org and again for www.dnsseed.yourcoin.org. Alternatively, if you self-host, you will need to use the run in this Linux terminal command to create the NS record:

Code:
dnsseed.yourcoin.org   86400    IN      NS     192.168.0.1

(Obviously changing the dnsseed.yourcoin.org and 192.168.0.1 to the relevant domain name and IP address of your VPS).

2.2) Create an 'A Record' (Address record) that points your dnsseed.yourcoin.org to the IP address of your VPS.

You can check the DNS status by typing the following into a Windows/Linux/Mac command prompt/terminal, even on your home PC:

Code:
nslookup dnsseed.yourcoin.org

The IP address of your VPS should be displayed if the record is working correctly but be aware it may take a while for the DNS record to propagate, so please be patient.

Please note that some web hosts do not allow you to create NS records on shared hosting plans, so if the option to create one isn't available, send their support team a message. They create one for you or may tell you that you need to upgrade your hosting plan. Try your luck with just an A record instead and see if it works.


Running the seeder

The seeder has to be compiled before it can be used!

3.1) Clone your seeder’s GitHub repository onto the VPS/server that will be running it and navigate into the seeder’s main folder.

3.2) If you are using 64-bit operating systems, make sure that initial compiler flags in the Makefile are set to:

Code:
CXXFLAGS = -O3 -g0 	(i.e. remove –march=native because this will cause architecture issues)

3.3) To compile, type the following the terminal:

Code:
make

3.4)  Now you need to instruct the seeder to run and look up the host and name server, so in the terminal you need to enter something along the lines of the following but (obviously!!)..... change dnsseed.yourcoin.org to your seeder’s website address and the 192.168.0.1 to your server/VPS IP address.

Code:
./dnsseed -h dnsseed.yourcoin.org -n 192.168.0.1

This guide isn’t a definitive guide and WILL need some improvements so if you come across any problems, please post them in here rather than PM me as I don’t have time to help everybody. Hopefully people who have come across similar issues too will be able to help out and turn this thread into something that is a useful resource.

1714104962
Hero Member
*
Offline Offline

Posts: 1714104962

View Profile Personal Message (Offline)

Ignore
1714104962
Reply with quote  #2

1714104962
Report to moderator
1714104962
Hero Member
*
Offline Offline

Posts: 1714104962

View Profile Personal Message (Offline)

Ignore
1714104962
Reply with quote  #2

1714104962
Report to moderator
1714104962
Hero Member
*
Offline Offline

Posts: 1714104962

View Profile Personal Message (Offline)

Ignore
1714104962
Reply with quote  #2

1714104962
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714104962
Hero Member
*
Offline Offline

Posts: 1714104962

View Profile Personal Message (Offline)

Ignore
1714104962
Reply with quote  #2

1714104962
Report to moderator
1714104962
Hero Member
*
Offline Offline

Posts: 1714104962

View Profile Personal Message (Offline)

Ignore
1714104962
Reply with quote  #2

1714104962
Report to moderator
1714104962
Hero Member
*
Offline Offline

Posts: 1714104962

View Profile Personal Message (Offline)

Ignore
1714104962
Reply with quote  #2

1714104962
Report to moderator
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1012


View Profile
May 07, 2014, 10:06:20 PM
 #2

Great guide!

“God does not play dice"
elbandi
Hero Member
*****
Offline Offline

Activity: 525
Merit: 529


View Profile
May 08, 2014, 12:10:30 AM
 #3

Just a note.
You sould create a NS domain record not an A record. Becase this seeder act as a dns server, and answer for the request with 3-4 valid ips.

Elbandi
behzadtala
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
June 16, 2014, 07:50:06 AM
 #4

is that possible to run yourcoind and software seeder software together on one server?
morinpa
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
June 28, 2014, 12:51:16 PM
 #5

Yes, it is possible.  They use different ports.
morinpa
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
June 28, 2014, 12:57:19 PM
 #6

Hey PereguineBerty

Thanks for the guide, it was helpful.

But I still have a question.  What does this do?

static inline int GetRequireHeight(const bool testnet = fTestNet)
  {
     return testnet ? 0 : 470000;
  }

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.

Thanks
psionin
Sr. Member
****
Offline Offline

Activity: 465
Merit: 254


View Profile
July 04, 2014, 07:54:05 PM
 #7

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?
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1012


View Profile
July 04, 2014, 10:49:57 PM
Merited by ABCbits (1)
 #8


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

“God does not play dice"
esotericizm
Hero Member
*****
Offline Offline

Activity: 750
Merit: 500



View Profile
July 04, 2014, 11:30:55 PM
 #9

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.
PereguineBerty (OP)
Member
**
Offline Offline

Activity: 109
Merit: 35


View Profile
July 06, 2014, 07:18:18 PM
Merited by ABCbits (2)
 #10

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.
PereguineBerty (OP)
Member
**
Offline Offline

Activity: 109
Merit: 35


View Profile
July 06, 2014, 07:28:14 PM
 #11

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.

puchisupport
Newbie
*
Offline Offline

Activity: 57
Merit: 0


View Profile
January 29, 2018, 03:44:11 AM
 #12

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.
lpxcc
Full Member
***
Offline Offline

Activity: 462
Merit: 105


View Profile
September 04, 2018, 03:24:24 AM
 #13

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
alias420
Newbie
*
Offline Offline

Activity: 68
Merit: 0


View Profile
September 16, 2018, 01:43:43 AM
 #14

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?
dbkeys
Full Member
***
Offline Offline

Activity: 484
Merit: 104


View Profile
September 16, 2018, 02:23:10 PM
Last edit: September 16, 2018, 02:37:03 PM by dbkeys
Merited by ABCbits (1)
 #15

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 dbkeys@bitmark.io

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

DNS Seeder / Node Trackers
dbkeys
Full Member
***
Offline Offline

Activity: 484
Merit: 104


View Profile
September 16, 2018, 03:13:07 PM
Last edit: September 19, 2018, 10:20:06 AM by dbkeys
 #16

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.

DNS Seeder / Node Trackers
CubitDev
Newbie
*
Offline Offline

Activity: 6
Merit: 1


View Profile
September 25, 2018, 10:40:41 PM
 #17

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 /<dir>/<application> [-]<parameters>

That should do it.
Walter_
Newbie
*
Offline Offline

Activity: 22
Merit: 2


View Profile
September 26, 2018, 08:02:39 AM
Merited by ABCbits (2)
 #18

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=/<LOCATION>/coin-seeder
ExecStart=/<LOCATION>/coin-seeder/dnsseed -h <HOSTNAME> -n <IP> -m email@mail.com
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
Kalkulus
Full Member
***
Offline Offline

Activity: 315
Merit: 102



View Profile WWW
November 20, 2018, 12:15:34 PM
 #19

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!
Crazyhead90
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 14, 2018, 07:31:00 PM
 #20

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?
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!