Is it safe to take antibiotics during pregnancy?

Rita
Is it safe to take cephalexin 500mg during pregnancy? I have infection behind my ear, anyone experienced this ? Or advice any home remedies to heal infection?