Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Validating a FQDN #925
I need to be able to validate a fully qualified domain name (FQDN). This has a few differences in comparison to
It doesn't necessarily have to check against a huge list of valid TLDs, but at least check for a TLD. You can see how they do it in this example from validator.js.
I'd be happy to submit a pull request for this, just lmk.
None of those actually check that the TLD is registered or anything just that it should be valid. This seems like a case where an extension could be made for Joi.
I'd be glad to help out with the Regex as I learned a ton from doing the one for
@DavidTPate it's just the RFC spec for domain names: https://tools.ietf.org/html/rfc1035. I think it should be an extension if it needs to actually do a DNS lookup to validate the domain, but for my specific use-case (and probably 90% of others), I don't need to go that deep. Just need to check that it should be valid, e.g. matches the correct regex.
Maybe there should be a shallow check implemented directly into