What Is the dn Parameter in a Magnet Link?

This article explains the purpose and functionality of the dn parameter within a BitTorrent magnet link. You will learn what the parameter stands for, how it provides a human-readable display name for torrent downloads, how URL encoding affects its format, and why it serves as a provisional name until full torrent metadata is retrieved from peers.

Understanding the dn Parameter

In a standard Magnet URI scheme, the dn parameter stands for Display Name. Its primary role is to specify a human-readable title for the file or collection of files being shared, allowing BitTorrent clients to label the transfer clearly in the user interface.

A basic magnet link structure containing the parameter looks like this:

magnet:?xt=urn:btih:EXAMPLEHASH123456789&dn=Ubuntu+22.04+Desktop+ISO

In this example, the dn= portion instructs the torrent client to display “Ubuntu 22.04 Desktop ISO” as the name of the download.

How the Suggested Display Name Works

  1. Immediate Identification: A magnet link fundamentally relies on the exact cryptographic hash of the content, defined by the xt (Exact Topic) parameter. Because hashes are long strings of alphanumeric characters (such as urn:btih: followed by a 40-character hex string), they do not convey what is actually being downloaded. The dn parameter bridges this gap by offering an instant name before any network data is transferred.

  2. URL Encoding Requirement: Because magnet links are standard Uniform Resource Identifiers (URIs), the text inside the dn parameter must follow standard percent-encoding rules. Spaces are typically replaced with + or %20, and special symbols are converted into their respective hexadecimal ASCII codes (e.g., & becomes %26). Torrent clients automatically parse these encoded characters back into standard text.

  3. Fallback and Metadata Overwrite: The display name provided by the dn parameter is purely a suggestion. When you first add a magnet link, your client does not yet have the full .torrent metadata file containing the exact file list and internal directory structure. The client displays the dn string as a placeholder. Once connected to peers in the swarm, the client downloads the actual metadata payload. Depending on the client’s settings, the provisional display name may be replaced with the authoritative file or folder name embedded directly inside the retrieved metadata.