Resolve by peer id?

I was looking to the p2p stuff. Specifically the p2p http proxy stuff and was wondering if there was any way to route to a node by peer id. All the examples use a multiaddr so you need to know the peer’s IP address, I think there’s a dns multiaddr, but that still wouldn’t be as ideal as using the peer id since the ip can change. If you could it would be nice to have something like dnslink for peerid. (I think or maybe it’s stupid if you could just use dns. I’ll have to think about that for a bit)

I think what I might be proposing is a multiaddr for peerid?

EDIT: It looks like you can associate the peer id, or actually anything, to a dns record with a dnsaddr multi address.

It also looks like you can route to the peer id with the /p2p multi address

Peers are routed via DHT. When your peer starts, it inserts a record on the DHT mapping peer ID to multiaddresses. Anyone wanting to connect to your peer by just having the peer ID can look it up.