A study of ancient dog DNA shows man’s best friend has been at our side for at least 9,000 years.