The calculated distance (air line) between Cockenzie and Dunbar is approximately 18 miles respectively 28 kilometers.
By car or train, the actual journey to Dunbar is certainly longer, as only the direct route (as the crow flies) between Cockenzie and Dunbar has been calculated here.