In the Dungeons & Dragons (D&D) role-playing game, the Dungeon Master (often abbreviated as DM) is the game organizer and participant in charge of creating the details and challenges of a given adventure, while maintaining a realistic continuity of events. In effect, the Dungeon Master controls all aspects of the game, except for the actions of the player characters, (PCs) and describes to the other players what they see and hear.
The title was invented for the TSR Dungeons & Dragons RPG, and was introduced in the second supplement to the game rules (Blackmoor). To avoid infringement of TSR's trademarks, and to describe referees in role-playing genres other than sword and sorcery, other gaming companies use more generic terms, like Game Master, Game Operations Director, Judge, Referee or Storyteller.
The Dungeon Master (DM) assumes the role of the game master or referee and describes for other players what they perceive in this imaginary world, and what effects their actions have. That person is responsible for preparing each game session, and must have a thorough understanding of the game rules. Since the inception of the Advanced Dungeons & Dragons system in 1977, these rules have been contained in three hardbound books: the Player's Handbook, Dungeon Master's Guide, and Monster Manual. Many other rulebooks exist as well, but these are not required for conducting the game.
The DM is responsible for narrative flow, creating the scenario and setting in which the game takes place, maintaining the pace and providing dynamic feedback. In storyteller role, the DM is responsible for describing the events of the D&D game session and making rulings about game situations and effects based on the decisions made by the players. The DM can develop the adventure plot and setting in which these PCs participate or use a preexisting module. This is typically designed as a type of decision tree that is followed by the players, and a customized version can require several hours of preparation for each hour spent playing the game.
The DM serves as the arbiter of the rules, both in teaching the rules to the players and in enforcing them. The rules provide game mechanics for resolving the outcome of events, including how the player's characters interact with the game world. Although the rules exist to provide a balanced game environment, the DM is free to ignore the rules as needed. The DM can modify, remove, or create entirely new rules in order to fit the rules to the current campaign. This includes situations where the rules do not readily apply, making it necessary to improvise. An example would be if the PCs are attacked by a living statue. To destroy the enemy, one PC soaks the statue in water, while the second uses his cone of cold breath to freeze the water. At this point, he appeals to the DM, saying the water expands as it freezes and shatters the statue. The DM might allow it, or roll dice to decide. In the above example the probability roll might come up in favor of the players, and the enemy would be shattered. Conversely, rules do not fit all eventualities and may have unintended consequences. The DM must ultimately draw the line between creative utilization of resources (e.g. firing wooden arrows into a dragon, then using a spell that warps wood at a distance) and exploit (e.g. "horse bombing" - using a non-combat spell that creates a temporary mount, several dozen feet above an enemy; hiring several thousand commoners to form a line and use a rule that allows characters pass items to each other immediately to propel objects at railgun speeds.)
Gaming groups 
Regular gaming groups consist of a dungeon master and several players. Some meet weekly or monthly, while others may only meet two or three times a year. A DM can also run a single adventure otherwise unconnected with a campaign or game world. In this latter case there is no connected plot, and the players can choose to play different characters in each session.
The game session is typically known as an "adventure." It can be metaphorically described as an act within a stage play, where the players are the lead actors. In this analogy, the DM provides the stage, the scenery, and the basic plot on which the improvisational script is built, as well as all the bit parts and supporting characters. Typically, each player generates a fictional player character (PC) to play within the adventure.
A series of adventures generally compose a campaign, and the player's characters will often remain as elements of the continuing story arc unless they meet an unfortunate demise. Using the stage play analogy, a campaign would comprise all acts of said play. While each adventure may have its own story arc, they are usually parts of the larger story arc of the campaign. The DM strings individual adventures into this campaign, in which the same PCs fight many different monsters and a few recurring villains; the PCs gain treasure, reputation and power as they go. Such campaigns can last for years or decades, earning a great deal of loyalty from their players. Also, there can be a common theme (e. g., find the Sword of Light) to a number of adventures that may in time become a campaign of sorts.
Beyond the campaign is the "game world". This vast construct is typical of many fantasy novels, such as J.R.R. Tolkien's Middle-earth or Robert E. Howard's Conan saga. DMs may choose to run a game based on a published game world, with the maps and history already in place; such game worlds often have pre-written adventures. Alternately, the DM may build their own world and create their own adventures.
- "Dungeons & Dragons FAQ". Wizards of the Coast. Archived from the original on 2008-10-03. Retrieved 2008-10-03.
- La Farge, Paul (September 2006). "Destroy All Monsters". The Believer Magazine. Archived from the original on 2008-10-04.
- Livingstone, Ian (1982). Dicing with Dragons. Routledge. p. 72. ISBN 0-7100-9466-3.
- Kushner, David (2008-03-10). "Dungeon Master: The Life and Legacy of Gary Gygax". Wired.com. Retrieved 2008-10-16.
- Kushner, David (2008-03-10). "Dungeon Master: The Life and Legacy of Gary Gygax". Wired. Retrieved 2008-11-19.
- Tychsen, Anders; Hitchens, Michael; Brolund, Thea; Kavakli, Manolya (2005). "The Game Master". Proceedings of the second Australasian conference on Interactive entertainment. Sydney, Australia: ACM. pp. 215–222. Retrieved 2008-11-25.
- Nugent, Benjamin (2007). American Nerd: The Story of My People. Simon and Schuster. pp. 190–192. ISBN 0-7432-8801-7.