<p>Couple of points covering what it is and how it works:</p>

<ul>
<li><p><a href="https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery" rel="nofollow noreferrer">The description</a> might be out of date.  You'd need to follow the code to see how seeding is done.  E.g. IRC seeding is not used any more (but that is noted).</p></li>
<li><p>Those addresses are DNS seeds.  They run a <a href="https://en.wikipedia.org/wiki/Name_server" rel="nofollow noreferrer">DNS name server</a> which is usually used to translate website names (like www.google.com) to IP addresses (eg 123.123.123.321).  They've made the code such that those DNS server instead of returning IP addresses of servers return the IP addresses of bitcoin nodes.</p></li>
<li><p>DNS operates on port UDP port 53 (and TCP) so you would not expect anything when browsing to those DNS seeds.</p></li>
<li><p>This is done by <a href="https://github.com/sipa/bitcoin-seeder" rel="nofollow noreferrer">running special software</a> that aims to find nodes on the network.  It keeps track of nodes that are consistently available and serves those randomly in response to DNS requests.</p></li>
<li><p>When a new node comes on line it will not have a history of peers it previously connected to and will contact these DNS seeds to obtain addresses of random nodes to connect to. </p></li>
<li><p>The next time a node starts up it will connect to peers it previously connected to (rather than DNS seeds).  If it can't connect to any it will retry the DNS seeds.  </p></li>
<li><p>Nodes that are connected to existing nodes also share details of nodes they are connected to.</p></li>
<li><p>A seed node is typically a last resort.  It's a hard coded node IP that is running the node software that uses the standard (or near standard) bitcoin protocol to talk to nodes connecting to it.  This is not using DNS. This may be a last resort node to connect to if other options fail.</p></li>
</ul>

<p>To implement your own for your altcoin you'd need to replicate this infrastructure.  You could just start with a fixed IP node(s) on your network but to enable decentralisation a couple of independently run DNS seeds are probably a good idea.</p>

<p>The crawler / DNS seed software would need to be adapted to understand the communication protocol of your coin to find all nodes in your network.</p>

CC BY-SA 3.0
2017-05-11T13:40:40.587Z
thanks for this awesome answer! Could I make those nodes docker containers running on my local machine or a raspberry pi to start with?
smatthewenglish
CC BY-SA 3.0
2017-05-11T14:53:23.973Z
I don't see why not, but to aid decentralisation you should probably add get others to host them as well.
Louis
CC BY-SA 3.0
2017-05-11T15:47:08.117Z
yeah I think I'll do that, but just in the very beginning I'll have them on docker containers on my own machine, then raspberry pis I guess and then later I'll deploy it on real machines. do you know of any reference implementation of what one of those looks like?
smatthewenglish
CC BY-SA 3.0
2017-05-11T16:10:39.147Z
I linked code for the bitcoin dns seeder in the answer.
Louis
CC BY-SA 3.0
2017-05-11T13:31:20.233Z
2017-05-11T13:31:20.233Z
Louis
<p>In <a href="https://bitcoin.stackexchange.com/questions/3711/what-are-seednodes">this question</a> we have a superficial explanation of vSeeds (seednodes), from the <a href="https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery" rel="nofollow noreferrer">Bitcoin wiki</a>, we have: </p>

<blockquote>
  <p>DNS Addresses
  Upon startup, if peer node discovery is needed, the client then issues DNS requests to learn about the addresses of other peer nodes. The client includes a list of host names for DNS services that are seeded. As-of May 17, 2012 the list (from <code>chainparams.cpp</code>) includes:</p>
</blockquote>

<pre><code>bitseed.xf2.org
dnsseed.bluematt.me
seed.bitcoin.sipa.be
dnsseed.bitcoin.dashjr.org
seed.bitcoinstats.com
</code></pre>

<blockquote>
  <p>A DNS reply can contain multiple IP addresses for a requested name.
   Addresses discovered via DNS are initially given a zero timestamp, therefore they are not advertised in response to a "getaddr" request.</p>
  
  <p>Hard Coded "Seed" Addresses
  The client contains hard coded IP addresses that represent bitcoin nodes.
  These addresses are only used as a last resort, if no other method has produced any addresses at all. When the loop in the connection handling thread ThreadOpenConnections2() sees an empty address map, it uses the "seed" IP addresses as backup.</p>
</blockquote>

<p>In the Bitcoin core code base it looks like this: </p>

<pre><code>// Note that of those with the service bits flag, most only support a subset of possible options
vSeeds.push_back(CDNSSeedData("bitcoin.sipa.be", "seed.bitcoin.sipa.be", true)); // Pieter Wuille, only supports x1, x5, x9, and xd
vSeeds.push_back(CDNSSeedData("bluematt.me", "dnsseed.bluematt.me", true)); // Matt Corallo, only supports x9
vSeeds.push_back(CDNSSeedData("dashjr.org", "dnsseed.bitcoin.dashjr.org")); // Luke Dashjr
vSeeds.push_back(CDNSSeedData("bitcoinstats.com", "seed.bitcoinstats.com", true)); // Christian Decker, supports x1 - xf
vSeeds.push_back(CDNSSeedData("bitcoin.jonasschnelli.ch", "seed.bitcoin.jonasschnelli.ch", true)); // Jonas Schnelli, only supports x1, x5, x9, and xd
vSeeds.push_back(CDNSSeedData("petertodd.org", "seed.btc.petertodd.org", true)); // Peter Todd, only supports x1, x5, x9, and xd
</code></pre>

<p>When you actually go to those addresses in a browser you get something unintelligible, such as this: </p>

<p><a href="https://i.sstatic.net/h1Zbk.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/h1Zbk.png" alt="enter image description here"></a></p>

<p>All close forks of Bitcoin have them in some way including Dogecoin here: </p>

<pre><code>vSeeds.push_back(CDNSSeedData("dogecoin.com", "seed.dogecoin.com"));
vSeeds.push_back(CDNSSeedData("multidoge.org", "seed.multidoge.org"));
vSeeds.push_back(CDNSSeedData("multidoge.org", "seed2.multidoge.org"));
vSeeds.push_back(CDNSSeedData("doger.dogecoin.com", "seed.doger.dogecoin.com"));
</code></pre>

<p>and here Litecoin:</p>

<pre><code>vSeeds.push_back(CDNSSeedData("loshan.co.uk", "seed-a.litecoin.loshan.co.uk", true));
vSeeds.push_back(CDNSSeedData("thrasher.io", "dnsseed.thrasher.io", true));
vSeeds.push_back(CDNSSeedData("litecointools.com", "dnsseed.litecointools.com"));
vSeeds.push_back(CDNSSeedData("litecoinpool.org", "dnsseed.litecoinpool.org"));
vSeeds.push_back(CDNSSeedData("koin-project.com", "dnsseed.koin-project.com"));
</code></pre>

<p>The question is, what are they exactly, i.e. what data do they provide, in what format? How are they configured? </p>

<p>Would I be able to create seednodes out of docker containers for a new network? </p>

<p>What tools could I use to query those nodes listed earlier? </p>

<p><strong>Does anyone have a reference implementation for one of these?</strong></p>

<network><altcoin><altcoin-development><seed><dns>
What precisely are vSeeds "seednodes", how to they work, how to create one for a new network?
smatthewenglish
# What precisely are vSeeds "seednodes", how to they work, how to create one for a new network?

(Asked by: username_0 on 2017-05-11)

In [this question](https://bitcoin.stackexchange.com/questions/3711/what-are-seednodes) we have a superficial explanation of vSeeds (seednodes), from the [Bitcoin wiki](https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery), we have:

> DNS Addresses
> Upon startup, if peer node discovery is needed, the client then issues DNS requests to learn about the addresses of other peer nodes. The client includes a list of host names for DNS services that are seeded. As-of May 17, 2012 the list (from `chainparams.cpp`) includes:

```
bitseed.xf2.org
dnsseed.bluematt.me
seed.bitcoin.sipa.be
dnsseed.bitcoin.dashjr.org
seed.bitcoinstats.com

```

> A DNS reply can contain multiple IP addresses for a requested name.
> Addresses discovered via DNS are initially given a zero timestamp, therefore they are not advertised in response to a "getaddr" request.
>
> Hard Coded "Seed" Addresses
> The client contains hard coded IP addresses that represent bitcoin nodes.
> These addresses are only used as a last resort, if no other method has produced any addresses at all. When the loop in the connection handling thread ThreadOpenConnections2() sees an empty address map, it uses the "seed" IP addresses as backup.

In the Bitcoin core code base it looks like this:

```
// Note that of those with the service bits flag, most only support a subset of possible options
vSeeds.push_back(CDNSSeedData("bitcoin.sipa.be", "seed.bitcoin.sipa.be", true)); // Pieter Wuille, only supports x1, x5, x9, and xd
vSeeds.push_back(CDNSSeedData("bluematt.me", "dnsseed.bluematt.me", true)); // Matt Corallo, only supports x9
vSeeds.push_back(CDNSSeedData("dashjr.org", "dnsseed.bitcoin.dashjr.org")); // Luke Dashjr
vSeeds.push_back(CDNSSeedData("bitcoinstats.com", "seed.bitcoinstats.com", true)); // Christian Decker, supports x1 - xf
vSeeds.push_back(CDNSSeedData("bitcoin.jonasschnelli.ch", "seed.bitcoin.jonasschnelli.ch", true)); // Jonas Schnelli, only supports x1, x5, x9, and xd
vSeeds.push_back(CDNSSeedData("petertodd.org", "seed.btc.petertodd.org", true)); // Peter Todd, only supports x1, x5, x9, and xd

```

When you actually go to those addresses in a browser you get something unintelligible, such as this:

[![enter image description here](https://i.sstatic.net/h1Zbk.png)](https://i.sstatic.net/h1Zbk.png)

All close forks of Bitcoin have them in some way including Dogecoin here:

```
vSeeds.push_back(CDNSSeedData("dogecoin.com", "seed.dogecoin.com"));
vSeeds.push_back(CDNSSeedData("multidoge.org", "seed.multidoge.org"));
vSeeds.push_back(CDNSSeedData("multidoge.org", "seed2.multidoge.org"));
vSeeds.push_back(CDNSSeedData("doger.dogecoin.com", "seed.doger.dogecoin.com"));

```

and here Litecoin:

```
vSeeds.push_back(CDNSSeedData("loshan.co.uk", "seed-a.litecoin.loshan.co.uk", true));
vSeeds.push_back(CDNSSeedData("thrasher.io", "dnsseed.thrasher.io", true));
vSeeds.push_back(CDNSSeedData("litecointools.com", "dnsseed.litecointools.com"));
vSeeds.push_back(CDNSSeedData("litecoinpool.org", "dnsseed.litecoinpool.org"));
vSeeds.push_back(CDNSSeedData("koin-project.com", "dnsseed.koin-project.com"));

```

The question is, what are they exactly, i.e. what data do they provide, in what format? How are they configured?

Would I be able to create seednodes out of docker containers for a new network?

What tools could I use to query those nodes listed earlier?

**Does anyone have a reference implementation for one of these?**

**Tags:** network, altcoin, altcoin-development, seed, dns


---

## 1 answers

### Answer by username_1 on 2017-05-11. Score: 3

Couple of points covering what it is and how it works:

* [The description](https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery) might be out of date. You'd need to follow the code to see how seeding is done. E.g. IRC seeding is not used any more (but that is noted).
* Those addresses are DNS seeds. They run a [DNS name server](https://en.wikipedia.org/wiki/Name_server) which is usually used to translate website names (like www.google.com) to IP addresses (eg 123.123.123.321). They've made the code such that those DNS server instead of returning IP addresses of servers return the IP addresses of bitcoin nodes.
* DNS operates on port UDP port 53 (and TCP) so you would not expect anything when browsing to those DNS seeds.
* This is done by [running special software](https://github.com/sipa/bitcoin-seeder) that aims to find nodes on the network. It keeps track of nodes that are consistently available and serves those randomly in response to DNS requests.
* When a new node comes on line it will not have a history of peers it previously connected to and will contact these DNS seeds to obtain addresses of random nodes to connect to.
* The next time a node starts up it will connect to peers it previously connected to (rather than DNS seeds). If it can't connect to any it will retry the DNS seeds.
* Nodes that are connected to existing nodes also share details of nodes they are connected to.
* A seed node is typically a last resort. It's a hard coded node IP that is running the node software that uses the standard (or near standard) bitcoin protocol to talk to nodes connecting to it. This is not using DNS. This may be a last resort node to connect to if other options fail.

To implement your own for your altcoin you'd need to replicate this infrastructure. You could just start with a fixed IP node(s) on your network but to enable decentralisation a couple of independently run DNS seeds are probably a good idea.

The crawler / DNS seed software would need to be adapted to understand the communication protocol of your coin to find all nodes in your network.

> **Comments:**
> **username_0**: thanks for this awesome answer! Could I make those nodes docker containers running on my local machine or a raspberry pi to start with?  
> **username_1**: I don't see why not, but to aid decentralisation you should probably add get others to host them as well.  
> **username_0**: yeah I think I'll do that, but just in the very beginning I'll have them on docker containers on my own machine, then raspberry pis I guess and then later I'll deploy it on real machines. do you know of any reference implementation of what one of those looks like?  
> **username_1**: I linked code for the bitcoin dns seeder in the answer.  

---

