An angry judge just ripped Gary Dourdan a new one ... after learning the former "CSI" star illegally texted his former GF ... allegedly.
Dourdan pled not guilty to felony domestic violence charges for allegedly breaking Nicole Vail Cannizzaro's nose.
Immediately after Dourdan was arrested last month, the police got a restraining order which prohibited the actor from contacting his ex, but the D.A. claims Dourdan violated that order by texting her.
Judge Keith Schwartz told Dourdan, "I don't mess around with domestic violence cases ... You understand?"
The judge issued a 3 year restraining order and gave Dourdan an ultimatum -- stay the hell away from her, or he's going to jail ... NOW.