On bitcoin peer node discovery, the client issues DNS requests to learn about the addresses of other peer nodes. My question is how does this DNS directed service provider learn about all the addresses in the first place?
2 Answers
Each normal node should connect to the seeder, this connection is detected by seeder service, that will test the node and add it to the list if some basic verification pass.
Exist other additional features, like for example fetch node list from main know seeder DNS into new seeders services.
The real virtue of the SIPA node_tracker / DNS_seeder is that it discovers nodes continually. It spawns threads to crawl the bitcoin P2P network. That is, having some good nodes to start with ( which are, for example, hard-coded in Sipa's original bitcoin-seeder in main.cpp:
static const string mainnet_seeds[] = {"dnsseed.bluematt.me", "bitseed.xf2.org", "dnsseed.bitcoin.dashjr.org", "seed.bitcoin.sipa.be", ""};
static const string testnet_seeds[] = {"testnet-seed.alexykot.me",
"testnet-seed.bitcoin.petertodd.org",
"testnet-seed.bluematt.me",
"testnet-seed.bitcoin.schildbach.de",
""};
and provided in the settings.conf
file of derivative works like Team-Exor's generic-seeder & my own multiseeder:
seed_1="seed.bitcoin.sipa.be" // At least one valid seed ip address is required to begin crawling the network
seed_2="dnsseed.bluematt.me"
seed_3="dnsseed.bitcoin.dashjr.org" // these may be IP numbers, not only names
seed_4="54.94.158.137"
seed_5="seed.bitcoin.jonasschnelli.ch"
seed_6="seed.btc.petertodd.org"
seed_7="seed.bitcoin.sprovoost.nl"
seed_8="dnsseed.emzy.de"
seed_9="seed.bitcoin.wiz.biz"
) the seeder sets out on a discovery mission, asking each node it knows to be good for its peers, then goes to those peers, and so on. That is how it builds a very large database of peers.