<p>There's <a href="https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery">a couple of methods the client can use</a>. However, unlike David's very good answer, I'll talk about them in chronological order:</p>

<ul>
<li>The number one way that clients learn about other clients is by connecting to another client and issuing the 'getaddr' command. The standard client has always had that ability. However, there's a problem with this - how do you learn about client #1?</li>
<li>IRC seeding. This is something that's been in since the first version too. It was simple to implement, but ultimately didn't scale. The first version connected to freenode. Then, bitcoin nodes <a href="https://bitcointalk.org/index.php?topic=199.msg1787#msg1787">started getting k-lined</a>. <a href="https://github.com/bitcoin/bitcoin/commit/06c47163962ce418569d9386770001c7a79c026e">Later versions</a> connected to lfnet. Then, lfnet went down, and <a href="https://github.com/bitcoin/bitcoin/commit/c2efd981aa14e94cce4a0a888b6ee1f4e4347924">IRC support was removed entirely.</a> DNS was around by this point, so that was fine.</li>
<li>IP addresses of well known nodes. <a href="https://github.com/bitcoin/bitcoin/commit/24ba1b64e93baafba2657ba7d8b63c759c3439ce">This has been in the client since June 2010.</a> Still in the Bitcoin client, though the exact IP addresses change every so often.</li>
<li>DNS seeding. <a href="https://github.com/bitcoin/bitcoin/commit/f684aec4f38d6a9e48e870ca5dae6bd65da516cf">This has been in the client since March 2011.</a> This is easier to scale, because DNS is already built to handle tens of thousands of connections.</li>
</ul>

CC BY-SA 3.0
2013-05-28T06:41:39.417Z
2014-05-01T21:27:34.777Z
2014-05-01T21:27:34.777Z
Nick ODell
<p>Bitcoin clients use several methods to locate other clients. The primary method is a list of nodes from a previous connection to the network. The works very well for everything but your first connection or a connection after a very long period of disconnection.</p>

<p>For the case where you have no previous known IPs or they aren't usable, the primary fallback method is by DNS seeds. Several host names (such as <em>dnsseed.bluematt.me</em>) are maintained that resolve to a list of IP addresses known to be running nodes. Should that fail, the client has a list of IP addresses believed to point to stable nodes hard-coded into it.</p>

<p>One method that used to be used, but that has since been abandoned, was having the clients locate each other using an IRC server. That worked similar to a BitTorrent tracker.</p>

<p>Once you are connected to the network, you will begin to receive lists of IP addresses and ports of known clients.</p>

CC BY-SA 3.0
2013-04-14T12:52:40.613Z
when you guys mention IRC, what IRC network exactly?
knocte
CC BY-SA 3.0
2013-04-14T13:03:24.100Z
@knocte It used to use irc.lfnet.org, joining a random channel between `#bitcoin00` and `#bitcoin99`.
David Schwartz
CC BY-SA 3.0
2013-04-14T14:12:31.800Z
so if lfnet.org went down, that was a single point of failure? what now, who dictates what are the DNS names to lookup?
knocte
CC BY-SA 3.0
2013-04-14T14:14:32.400Z
@knocte: It wouldn't have been a single point of failure because the client had several other bootstrapping methods including several hardcoded "well known" servers. Anyone who wants to can set their client to use whatever DNS names they want. The official client uses a list maintained by the developers. I believe the developers solicited volunteers to run DNS seeds.
David Schwartz
CC BY-SA 3.0
2017-08-25T13:04:59.977Z
funny how a ripple enthusiast came up with this question (me), googled it and found an answer by you :-).. off topic, but had to share!
Hedde van der Heide
CC BY-SA 3.0
2017-08-25T17:53:11.680Z
@HeddevanderHeide I think most ripple enthusiasts are also bitcoin enthusiasts.
David Schwartz
CC BY-SA 3.0
2017-10-19T14:23:06.260Z
Ok. So Bitcoins ARE vulnerable to China's DNS poisoning ? Good to know.
Taiko
CC BY-SA 3.0
2017-10-19T20:07:31.423Z
@Taiko Not really, because DNS is only one method used. A bitcoin server needs only one connection to an honest node to be safe.
David Schwartz
CC BY-SA 3.0
2017-10-23T16:22:39.027Z
Problem is. DNS poisoning will also prevent connection to hard coded IPs. So first time connections can't work of the GFW of China blocks it. @David
Taiko
CC BY-SA 3.0
2017-10-24T18:37:54.670Z
@Taiko DNS poisoning has no effect on connections to hard coded IPs. You are right that an entity that controls your Internet access can break your ability to use bitcoin, just as it can break your ability to use any other Internet service. (Bitcoin is especially resilient, however, because just one leak saves everyone.)
David Schwartz
CC BY-SA 4.0
2020-12-13T14:39:02.247Z
I would like to consider the situation where the hard coded "known" client fails as well. If DNS fails and the hard coded known client fails, that would it be possible to randomly guess IPs on that port, and try sending signals out to random IPs until you find a Bitcoin node that responds?
Nearpoint
CC BY-SA 3.0
2012-05-01T15:10:44.040Z
When the Bitcoin.org client needs to discover peers, DNS seeds is the default for the client v0.6 and above.  IRC was the default for earlier versions.
Stephen Gornick
CC BY-SA 3.0
2012-05-01T06:15:46.977Z
2012-05-01T06:15:46.977Z
David Schwartz
<p>What protocols or algorithms are Bitcoin clients using in order to find their peers? I learnt that BitTorrent clients may rely on central computers called trackers. Do Bitcoin clients need any kind of central servers or nodes in order to operate?</p>

<peer-discovery>
How do Bitcoin clients find each other?
Ning
# How do Bitcoin clients find each other?

(Asked by: username_0 on 2012-05-01)

What protocols or algorithms are Bitcoin clients using in order to find their peers? I learnt that BitTorrent clients may rely on central computers called trackers. Do Bitcoin clients need any kind of central servers or nodes in order to operate?

**Tags:** peer-discovery


---

## 2 answers

### Answer by username_2 on 2012-05-01. Score: 143 | Accepted answer

Bitcoin clients use several methods to locate other clients. The primary method is a list of nodes from a previous connection to the network. The works very well for everything but your first connection or a connection after a very long period of disconnection.

For the case where you have no previous known IPs or they aren't usable, the primary fallback method is by DNS seeds. Several host names (such as *dnsseed.bluematt.me*) are maintained that resolve to a list of IP addresses known to be running nodes. Should that fail, the client has a list of IP addresses believed to point to stable nodes hard-coded into it.

One method that used to be used, but that has since been abandoned, was having the clients locate each other using an IRC server. That worked similar to a BitTorrent tracker.

Once you are connected to the network, you will begin to receive lists of IP addresses and ports of known clients.

> **Comments:**
> **username_7**: When the Bitcoin.org client needs to discover peers, DNS seeds is the default for the client v0.6 and above.  IRC was the default for earlier versions.  
> **username_3**: when you guys mention IRC, what IRC network exactly?  
> **username_2**: @username_3 It used to use irc.lfnet.org, joining a random channel between `#bitcoin00` and `#bitcoin99`.  
> **username_3**: so if lfnet.org went down, that was a single point of failure? what now, who dictates what are the DNS names to lookup?  
> **username_2**: @username_3: It wouldn't have been a single point of failure because the client had several other bootstrapping methods including several hardcoded "well known" servers. Anyone who wants to can set their client to use whatever DNS names they want. The official client uses a list maintained by the developers. I believe the developers solicited volunteers to run DNS seeds.  
> **username_4**: funny how a ripple enthusiast came up with this question (me), googled it and found an answer by you :-).. off topic, but had to share!  
> **username_2**: @username_4 I think most ripple enthusiasts are also bitcoin enthusiasts.  
> **username_5**: Ok. So Bitcoins ARE vulnerable to China's DNS poisoning ? Good to know.  
> **username_2**: @username_5 Not really, because DNS is only one method used. A bitcoin server needs only one connection to an honest node to be safe.  
> **username_5**: Problem is. DNS poisoning will also prevent connection to hard coded IPs. So first time connections can't work of the GFW of China blocks it. @username_2  
> **username_2**: @username_5 DNS poisoning has no effect on connections to hard coded IPs. You are right that an entity that controls your Internet access can break your ability to use bitcoin, just as it can break your ability to use any other Internet service. (Bitcoin is especially resilient, however, because just one leak saves everyone.)  
> **username_6**: I would like to consider the situation where the hard coded "known" client fails as well. If DNS fails and the hard coded known client fails, that would it be possible to randomly guess IPs on that port, and try sending signals out to random IPs until you find a Bitcoin node that responds?  

---

### Answer by username_1 on 2013-05-28. Score: 78

There's [a couple of methods the client can use](https://en.bitcoin.it/wiki/Satoshi_Client_Node_Discovery). However, unlike username_2's very good answer, I'll talk about them in chronological order:

* The number one way that clients learn about other clients is by connecting to another client and issuing the 'getaddr' command. The standard client has always had that ability. However, there's a problem with this - how do you learn about client #1?
* IRC seeding. This is something that's been in since the first version too. It was simple to implement, but ultimately didn't scale. The first version connected to freenode. Then, bitcoin nodes [started getting k-lined](https://bitcointalk.org/index.php?topic=199.msg1787#msg1787). [Later versions](https://github.com/bitcoin/bitcoin/commit/06c47163962ce418569d9386770001c7a79c026e) connected to lfnet. Then, lfnet went down, and [IRC support was removed entirely.](https://github.com/bitcoin/bitcoin/commit/c2efd981aa14e94cce4a0a888b6ee1f4e4347924) DNS was around by this point, so that was fine.
* IP addresses of well known nodes. [This has been in the client since June 2010.](https://github.com/bitcoin/bitcoin/commit/24ba1b64e93baafba2657ba7d8b63c759c3439ce) Still in the Bitcoin client, though the exact IP addresses change every so often.
* DNS seeding. [This has been in the client since March 2011.](https://github.com/bitcoin/bitcoin/commit/f684aec4f38d6a9e48e870ca5dae6bd65da516cf) This is easier to scale, because DNS is already built to handle tens of thousands of connections.


---

