<p>The connection method depends on the client.</p>
<p>Bitcoin Core will spend up to 11 seconds trying to connect to a peer in its database.  If that doesn't work, it will query a DNS server (known as a DNS seed) to get addresses for peers the seed believes are active.  If that doesn't work within 60 seconds, it will fallback to one of its hardcoded addresses.  Once a connection is made to a remote peer, the local node will request more addresses from that remote peer.</p>
<p>Other clients may work differently---for example, BitcoinJ by default jumps straight to querying the DNS seeds.  If that doesn't work, it will fallback to hardcoded addresses.</p>
<p>A few more details may be found in the <a href="https://developer.bitcoin.org/devguide/p2p_network.html#peer-discovery" rel="nofollow noreferrer">Peer Discovery section of the Bitcoin.org Developer Guide</a>.</p>

CC BY-SA 4.0
2014-12-10T14:53:20.807Z
2024-12-04T18:06:25.443Z
2024-12-04T18:06:25.443Z
David A. Harding
<p>There are several bootstrap methods. I know of two:</p>

<ol>
<li>An specific IRC channel is joined by the client. In this channel, connected clients often broadcast their IP, to allow others to find them.</li>
<li>There is a list of hard-coded IPs in the client binary, which the client will connect to bootstrap its network.</li>
</ol>

CC BY-SA 3.0
2011-11-20T17:13:55.130Z
2011-11-20T17:13:55.130Z
ripper234
<p>The Bitcoin client has a number of sources that it uses to locate the network on initial startup. In order of importance:</p>

<p>1) The primary mechanism, if the client has ever run on this machine before and its database is intact, is to look at its database. It tracks every node it has seen on the network, how long ago it last saw it, and its IP address.</p>

<p>2) The client can use DNS to locate a list of nodes connected to the network. One such seed is <code>bitseed.xf2.org</code>. The client will resolve this and get a list of Bitcoin nodes.</p>

<p>3) The client has a list of semi-permanent nodes compiled into it.</p>

<p>4) The client can connect to a well-known IRC network, <code>irc.lfnet.org</code>, and find other nodes that way. (This method has been removed as of version 0.8.2)</p>

<p>5) It takes IP addresses from the commandline (-addnode).</p>

CC BY-SA 3.0
2011-12-04T14:58:39.310Z
5) It takes IP addresses from the commandline (-addnode).
Pieter Wuille
CC BY-SA 3.0
2011-11-20T19:48:18.893Z
2014-12-11T11:24:25.123Z
2014-12-11T11:24:25.123Z
David Schwartz
<p>Once the bitcoin client is connected to a machine (or multiple machines) on the bitcoin network, they can share information (e.g. the block-chain, IP addresses of other nodes, etc). I understand how this peer-to-peer architecture is robust to nodes joining/leaving/crashing and not relying on any central authority.</p>

<p>My question is: when I start my client, it has no information about the IP addresses of the other nodes, so how does it know who/where to connect to <strong>initially</strong>? How does one 'boot-strap' a peer-to-peer network?</p>

CC BY-SA 4.0
2018-09-13T15:06:34.313Z
Possible duplicate of [How do Bitcoin clients find each other?](https://bitcoin.stackexchange.com/questions/3536/how-do-bitcoin-clients-find-each-other)
MCCCS
<peer-discovery><dns>
How does the bitcoin client make the initial connection to the bitcoin network?
Ciaran
# How does the bitcoin client make the initial connection to the bitcoin network?

(Asked by: username_0 on 2011-11-20)

Once the bitcoin client is connected to a machine (or multiple machines) on the bitcoin network, they can share information (e.g. the block-chain, IP addresses of other nodes, etc). I understand how this peer-to-peer architecture is robust to nodes joining/leaving/crashing and not relying on any central authority.

My question is: when I start my client, it has no information about the IP addresses of the other nodes, so how does it know who/where to connect to **initially**? How does one 'boot-strap' a peer-to-peer network?

**Tags:** peer-discovery, dns

> **Comments:**
> **username_1**: Possible duplicate of [How do Bitcoin clients find each other?](https://bitcoin.stackexchange.com/questions/3536/how-do-bitcoin-clients-find-each-other)  

---

## 3 answers

### Answer by username_4 on 2011-11-20. Score: 39 | Accepted answer

The Bitcoin client has a number of sources that it uses to locate the network on initial startup. In order of importance:

1) The primary mechanism, if the client has ever run on this machine before and its database is intact, is to look at its database. It tracks every node it has seen on the network, how long ago it last saw it, and its IP address.

2) The client can use DNS to locate a list of nodes connected to the network. One such seed is `bitseed.xf2.org`. The client will resolve this and get a list of Bitcoin nodes.

3) The client has a list of semi-permanent nodes compiled into it.

4) The client can connect to a well-known IRC network, `irc.lfnet.org`, and find other nodes that way. (This method has been removed as of version 0.8.2)

5) It takes IP addresses from the commandline (-addnode).

> **Comments:**
> **username_5**: 5) It takes IP addresses from the commandline (-addnode).  

---

### Answer by username_2 on 2014-12-10. Score: 7

The connection method depends on the client.

Bitcoin Core will spend up to 11 seconds trying to connect to a peer in its database. If that doesn't work, it will query a DNS server (known as a DNS seed) to get addresses for peers the seed believes are active. If that doesn't work within 60 seconds, it will fallback to one of its hardcoded addresses. Once a connection is made to a remote peer, the local node will request more addresses from that remote peer.

Other clients may work differently---for example, BitcoinJ by default jumps straight to querying the DNS seeds. If that doesn't work, it will fallback to hardcoded addresses.

A few more details may be found in the [Peer Discovery section of the Bitcoin.org Developer Guide](https://developer.bitcoin.org/devguide/p2p_network.html#peer-discovery).


---

### Answer by username_3 on 2011-11-20. Score: 5

There are several bootstrap methods. I know of two:

1. An specific IRC channel is joined by the client. In this channel, connected clients often broadcast their IP, to allow others to find them.
2. There is a list of hard-coded IPs in the client binary, which the client will connect to bootstrap its network.


---

