How Bitcoin client handles DNS seeds?

1

1

Command

nslookup seed.bitcoin.sipa.be

gives a list of 40 nodes.

1) Does Bitcoin wallet take all nodes from that list?

or

2) Does Bitcoin wallet behave like normal application that resolves seed.bitcoin.sipa.be and take only one IP address to connect.

JPX

Posted 2017-10-10T14:07:12.213

Reputation: 123

Answers

0

seed.bitcoin.sipa.be and the other DNS seeders listed here will return a list of IP addresses when given a DNS query. Bitcoin Core then takes all of those IP addresses and adds them to its internal address manager. It will then attempt connecting to the addresses stored in its address manager which, after the first start, will consist of more than just the nodes returned by the DNS seeders.

Andrew Chow

Posted 2017-10-10T14:07:12.213

Reputation: 40 910

Thanks. So this means that even if DNS seed returns a few invalid IP adresses it's not a problem because Bitcoin Core takes all IP adresses and finds the working ones.JPX 2017-10-11T12:49:08.367

Yes. And there are multiple DNS seeders so it will get nodes from other DNS seeders too.Andrew Chow 2017-10-11T14:17:12.170

If you define addnode=seed.xxxxxx.com or type addnode seed.xxxxxx.com add does Bitcoin Core add all IP addresses or just one IP address to it's address manager?JPX 2017-10-15T13:20:08.397

You cannot add DNS seeders via the command line or the RPC commands. addnode will add the one node that you enter to the address manager and then attempt to connect to it. There are no "all IP addresses" for it to even add; you are only giving it one IP address.Andrew Chow 2017-10-15T15:16:34.837

0

The bitcoin client will first try to scan for previous known IPs, once that fails, it will indeed fall back on DNS seeds.

It will resolve seed.bitcoin.sipa.be to a list of IP adresses and it will pick one of them.

Rutger Versteegden

Posted 2017-10-10T14:07:12.213

Reputation: 966

What if there is multiple DNS seeds? Will client pick one IP address from each DNS seed?JPX 2017-10-10T20:32:50.193