A magnitude 4.0 earthquake was recorded near Dublin in the Bay Area on Monday evening, the U.S. Geological Survey reported.