add test and ERB conditional logic for when ::domain not present