Vomiting is a very common symptom in dogs but has a huge range of causes; some minor and some very serious. Most cases resolve within 24 hours without veterinary attention.
True vomiting can be confused with retching (when your dog goes to vomit but nothing comes up) or regurgitation (your dog brings up undigested food immediately after eating). A single vomit is usually nothing to worry about, but if it happens multiple times or is accompanied by other symptoms (e.g. more than 24 hours duration, with diarrhoea, painful tummy or bloody vomit) then veterinary advice should be sought. Similarly, a single retch could just mean your dog has swallowed a piece of grass, but repeated retching especially if accompanied by a bloated belly could indicate a potentially life-threatening condition called a gastric torsion.
Regurgitation can occur if your dog has eaten too quickly, but if repetitive can be a sign of a megaoesophagus (when the tube from the throat to the stomach becomes dilated).
Symptoms of nausea include frequent lip licking, swallowing, salivating, anorexia, and restlessness.
If your dog has only vomited once or twice but seems well then you could try restricting food for 12-24 hours. Allow them access to small amounts of water frequently. If you allow them to drink a lot in one go it is very likely that the inflamed stomach will struggle to accommodate the fluid and it will come straight back up. If your dog has been sick again and is keeping the water down then try introducing small bland meals (chicken breast, white fish, are good examples). You can swap back to normal food after 48 hours if there is no further vomiting. Continue to allow frequent access to water. Allow them to rest and avoid walks for a couple of days especially if you suspect it could be something infectious.
Gastritis (inflammation of the stomach) is usually caused by eating something inappropriate and will generally settle by itself with the methods mentioned above. Gastroenteritis is inflammation of the stomach and intestines and is characterised by vomiting accompanied by diarrhoea. Minor cases will resolve on their own, but dogs will be more prone to dehydration so it's more likely that veterinary intervention will be required.
Haemorrhagic gastroenteritis occurs when the vomit or diarrhoea is bloody, this is much more serious and will almost always require veterinary help. A gut blockage or gastric torsion is characterised by frequent vomiting in combination with abdominal pain and bloating, this is considered an emergency. Vomiting is also a symptom of other diseases such as food allergies , hormonal abnormalities, pancreatitis, kidney, or liver diseases.
The type of vomit can be useful in helping diagnose the cause. Stomach acid or bile is yellow/green liquid, it occurs when the dog vomits on an empty stomach. Blood can be fresh or digested (like coffee grounds) and should be reported to your vet immediately in case of a gastric ulcer. Food can be digested or undigested depending on how long it has been in the stomach and is often associated with a bug or foreign body.
Your vet will usually want to run blood tests or X-rays to help diagnose the problem and to ascertain the best treatment.