How the owls find the recipients of the letters they carry is not specifically stated. In some circumstances, letters have extremely explicit addresses on them (specifying rooms or locations inside of a building). Other times, there is no mention of an address, and the owl is simply told to whom to deliver. The Ministry of Magic used to use owls to deliver inter-office mail within the ministry building, but according to Mr. Weasley, the mess was incredible. Now the ministry uses enchanted memos, which fly throughout the building as paper aeroplanes, rather than owls.