A magnitude 4.2 earthquake has been recorded in regional NSW, with more than 300 people feeling its effects.