In New Leaf
Once the player unlocks the Dream Suite through public works projects, they will be able to obtain a dream address. A dream address can be typed in before the player goes to sleep, and it will allow them to go to the town the address belongs to. Dream addresses can be found on a players' TPC (Town Pass Card).
To get a dream address, Luna will prompt the player to lie down on the couch. After this, she will create a dream for the player's town. She will remind the player to update their town frequently, so the dream doesn't get removed from their database. She also tells the player if they update their dream, they will receive a small token of her appreciation, which is 5,000 Bells. Dream towns can only be updated once a day. An example format of a dream address could be xxxx - xxxx - xxxx.
In New Horizons
After the player unlocks dreaming and sleeps in a bed for the first time, they will meet Luna and be given instructions on how to upload a dream of their island and visit other players' islands. The player receives a Dream Address for their island after uploading a dream. Sharing this address with other players is one of two ways for other players to visit that island. If the player has allowed thier island to be picked at random to surprise others, other players can also let Luna surprise them and allow themsleves to be transported to a random dream. These addresses can be uploaded once per day and saves the progress for the player's island. This acts as a backup save which will store and share the specific address with others. However, this can be altered and is typically found on a player's passport where they can make it public or private.