<p>It does! 
There is even a BOLT for it (check out: <a href="https://github.com/lightningnetwork/lightning-rfc/blob/master/10-dns-bootstrap.md" rel="nofollow noreferrer">https://github.com/lightningnetwork/lightning-rfc/blob/master/10-dns-bootstrap.md</a> ) </p>

<p>from there you have the following example: </p>

<pre><code>dig lseed.bitcoinstats.com AAAA
lseed.bitcoinstats.com. 60      IN      AAAA    2a02:aa16:1105:4a80:1234:1234:37c1:9c9
</code></pre>

<p>Christian Decker is maintaining the dns seed list. I even used this in my autopilot (<a href="https://github.com/renepickhardt/lightning-network-autopilot/blob/master/c-lightning-autopilot.py" rel="nofollow noreferrer">the c-lightning wrapper</a>). check out: </p>

<pre><code>  def __get_seed_keys(self):
        """
        retrieve the nodeids of the ln seed nodes from lseed.bitcoinstats.com
        """
        domain = "lseed.bitcoinstats.com"
        srv_records = dns.resolver.query(domain,"SRV")
        res = []
        for srv in srv_records:
            bech32 = str(srv.target).rstrip(".").split(".")[0]
            data = bech32_decode(bech32)[1]
            decoded = convertbits(data, 5, 4)
            res.append("".join(
                ['{:1x}'.format(integer) for integer in decoded])[:-1])
        return res


    def __connect_to_seeds(self):
        """
        sets up peering connection to seed nodes of the lightning network

        This is necessary in case the node operating the autopilot has never
        been connected to the lightning network.
        """
        try:
            for nodeid in random.shuffle(self.__get_seed_keys()):
                self.__clogger.info("peering with node: " + nodeid)
                self.__rpc_interface.connect(nodeid)
                # FIXME: better strategy than sleep(2) for building up
                time.sleep(2)
        except:
            pass
</code></pre>

CC BY-SA 4.0
2019-06-11T13:32:38.953Z
Nice, thanks! So the logical continuation of my question would then be - why isn't it used as the default connection mechanism, as in Bitcoin? (Or is it? I'm experimenting with Eclair and it I don't see that option; do c-lightning or LND have it?)
Sergei Tikhomirov
CC BY-SA 4.0
2019-06-11T13:42:37.307Z
That I don't know :( When you use my autopilot plugin it is being used. I guess in lightning the process is different. You only peer with a node when you want to create a channel anyway. So I guess the indirect answer is that the power of choice was left to the user
Rene Pickhardt
CC BY-SA 4.0
2019-06-11T14:02:33.013Z
Got it! The last thing I don't quite understand is how to specify the DNS query to get a _testnet_ node. BOLT10 [says](https://github.com/lightningnetwork/lightning-rfc/blob/master/10-dns-bootstrap.md#query-semantics) that the "realm byte" `r` is "used to specify what realm the returned nodes must support" with the default value of "0 (Bitcoin)", but it doesn't mention the values for other networks...
Sergei Tikhomirov
CC BY-SA 4.0
2019-06-11T13:29:05.300Z
2019-06-11T13:29:05.300Z
Rene Pickhardt
<p>Bitcoin uses a DNS-based bootstrapping mechanism to help new nodes find peers. As far as I'm aware, Lightning doesn't have such mechanism, and new users are supposed to just search for node addresses on the web (or use nodes maintained / recommended by their wallet developers, or whatever).</p>

<p>What is the rationale behind this design decision?</p>

<lightning-network><peer-discovery><dns>
Why doesn't Lightning have DNS bootstrapping?
Sergei Tikhomirov
# Why doesn't Lightning have DNS bootstrapping?

(Asked by: username_0 on 2019-06-11)

Bitcoin uses a DNS-based bootstrapping mechanism to help new nodes find peers. As far as I'm aware, Lightning doesn't have such mechanism, and new users are supposed to just search for node addresses on the web (or use nodes maintained / recommended by their wallet developers, or whatever).

What is the rationale behind this design decision?

**Tags:** lightning-network, peer-discovery, dns


---

## 1 answers

### Answer by username_1 on 2019-06-11. Score: 4

It does!
There is even a BOLT for it (check out: <https://github.com/lightningnetwork/lightning-rfc/blob/master/10-dns-bootstrap.md> )

from there you have the following example:

```
dig lseed.bitcoinstats.com AAAA
lseed.bitcoinstats.com. 60      IN      AAAA    2a02:aa16:1105:4a80:1234:1234:37c1:9c9

```

Christian Decker is maintaining the dns seed list. I even used this in my autopilot ([the c-lightning wrapper](https://github.com/username_1/lightning-network-autopilot/blob/master/c-lightning-autopilot.py)). check out:

```
  def __get_seed_keys(self):
        """
        retrieve the nodeids of the ln seed nodes from lseed.bitcoinstats.com
        """
        domain = "lseed.bitcoinstats.com"
        srv_records = dns.resolver.query(domain,"SRV")
        res = []
        for srv in srv_records:
            bech32 = str(srv.target).rstrip(".").split(".")[0]
            data = bech32_decode(bech32)[1]
            decoded = convertbits(data, 5, 4)
            res.append("".join(
                ['{:1x}'.format(integer) for integer in decoded])[:-1])
        return res

    def __connect_to_seeds(self):
        """
        sets up peering connection to seed nodes of the lightning network

        This is necessary in case the node operating the autopilot has never
        been connected to the lightning network.
        """
        try:
            for nodeid in random.shuffle(self.__get_seed_keys()):
                self.__clogger.info("peering with node: " + nodeid)
                self.__rpc_interface.connect(nodeid)
                # FIXME: better strategy than sleep(2) for building up
                time.sleep(2)
        except:
            pass

```

> **Comments:**
> **username_0**: Nice, thanks! So the logical continuation of my question would then be - why isn't it used as the default connection mechanism, as in Bitcoin? (Or is it? I'm experimenting with Eclair and it I don't see that option; do c-lightning or LND have it?)  
> **username_1**: That I don't know :( When you use my autopilot plugin it is being used. I guess in lightning the process is different. You only peer with a node when you want to create a channel anyway. So I guess the indirect answer is that the power of choice was left to the user  
> **username_0**: Got it! The last thing I don't quite understand is how to specify the DNS query to get a _testnet_ node. BOLT10 [says](https://github.com/lightningnetwork/lightning-rfc/blob/master/10-dns-bootstrap.md#query-semantics) that the "realm byte" `r` is "used to specify what realm the returned nodes must support" with the default value of "0 (Bitcoin)", but it doesn't mention the values for other networks...  

---

