Upvote:2
Usually the rules about international flights are saying that you must check-in at least 1 hour before going to the gate. Given that, combined with your departure time (1 A.M.), you should be fine, as you'll go through the passport control on the previous day, with a valid visa.
Every gate in Domodedovo has the border control, and a waiting zone after that, and usually you can check-in 3 hours before the flight. So, you should just pass the border checks before and enjoy your trip.
Upvote:4
If you clear passport control before midnight, it's fine. The Moment you're stamped out, you've officially departed Russia.