With a gluten-free diet, dermatitis herpetiformis may resolve within several months. However, in some cases, the condition can last for a few years.