The nuclear membrane, also called the nuclear envelope, surrounds the nucleus in a double layer with multiple pores that regulate the flow of protein and RNA. The pores also allow water, ATP and smaller molecules to flow freely through the membrane.
The membrane controls the flow of information into the nucleus and DNA because it is all carried by the macromolecules that it regulates. It also separates the material inside the membrane from the rest of the cell. This keeps the DNA safely housed in the center of the cell. Even though the DNA never leaves the nucleus it controls the majority of the processes that happen inside the cell.