Although simply importing the re module was sufficient to address the issues that came up in the earlier PR, I changed the logic a bit to favor utility in general.
Now, the basic logic is:
Do a lookup. Permit names that work.
If that fails, do a validation. Permit domain names that are valid (or that are valid except for having a hostname with an underscore - a legacy quirk reasonably likely to occur).
Use default for everything else, noting it in the log
This prioritizes utility while still being likely to give an error if there's a definitively bad hostname given.
Although simply importing the
re
module was sufficient to address the issues that came up in the earlier PR, I changed the logic a bit to favor utility in general.Now, the basic logic is:
This prioritizes utility while still being likely to give an error if there's a definitively bad hostname given.