Ductoscopy is generally performed under local anesthesia, which ensures the procedure is well-tolerated with minimal discomfort or pain.