There are three main methods (in order of preference):
1. Use a cached list from a previous run. This is ideal in terms of load balancing, and also helps with bootstrap time if your IP hasn't changed, so all major torrent clients have such a cache.
2. Ask peers you're connected to via a traditional tracker and .torrent file. This is the next best thing, but can only be used if the first torrent you download is via a traditional tracker.
3. Use some bootstrap peers hardcoded into the torrent client. Has a single point of failure, but it works.
Each torrent client can use a different set of bootstrap peers, note - they're nothing special, just a DHT peer that has the bandwidth and CPU power to deal with bootstrap requests (which isn't a very high hurdle - you only get hit once, on the initial install, or if the client's been shut down for so long it no longer has any valid peers). Or the user might even supply their own, if need be.
Thanks for the information, this part was always a mystery to me as well.
To clarify, if someone has never downloaded a torrent before and starts with a rarely downloaded file, would the use of only magnet links mean they will probably not be able to find another peer? It sounds like unless you already have torrents downloaded, your list of possible peers to check for the file is very short.
If your client connects to just one peer you essentially gain access to the entire bittorrent DHT network. As a dramatic simplification, your request for the rare torrent would propagate until it found the peers seeding or downloading it.
But what if the users sharing the file are also connecting for the first time? It seems like if my friend wants to seed a file and I want to download it, it only works if we knows peers (who know peers who know peers who...) know peers of me. Is this correct?
In theory (assuming that there are links to everyone, and no way to have separate networks) (it's of course a theory only, but seems very likely that there are "massive users", who have files of "every kind", connecting the different groups), as long as you both connect to one who is connected, it will work.
Although this is quite the extreme case, and not really the purpose for Bittorrent to begin with, I guess. The main interest is load balancing of popular downloads, not finding the one person with the one file for you.
I've actually found torrents to be a great way to share large files with a friend. There's no invasive upload dialog or locking, no practical filesize limitations other than the free space on my friend's computer, you don't have to upload to a public-facing server before your associate can start downloading, port forwarding is handled transparently by UPnP, client software is user-friendly, easily available, and often already running anyway, and it's easy to scale if another friend wants a copy at some point in the future.
Of course, TPB switching to magnets doesn't really affect this. Torrent files are still used to provide information on the download, they're just distributed from within the P2P network instead of TPB itself. If you have a torrent file to share with an individual or small group instead of the whole world, there's no reason to stop using torrent files directly.
1. Use a cached list from a previous run. This is ideal in terms of load balancing, and also helps with bootstrap time if your IP hasn't changed, so all major torrent clients have such a cache.
2. Ask peers you're connected to via a traditional tracker and .torrent file. This is the next best thing, but can only be used if the first torrent you download is via a traditional tracker.
3. Use some bootstrap peers hardcoded into the torrent client. Has a single point of failure, but it works.
Each torrent client can use a different set of bootstrap peers, note - they're nothing special, just a DHT peer that has the bandwidth and CPU power to deal with bootstrap requests (which isn't a very high hurdle - you only get hit once, on the initial install, or if the client's been shut down for so long it no longer has any valid peers). Or the user might even supply their own, if need be.