Hawkes Bay has been jolted by a magnitude 4.2 earthquake.