go-domain-util icon indicating copy to clipboard operation
go-domain-util copied to clipboard

Validate domain patterns

Open gohumble opened this issue 5 years ago • 2 comments

Hello again,

I have added isDomainName function. This will validate the domain name using the isDomainName function from golangs DNS lib. So this should be very solid. This function does not have public scope. That's why I had to copy it.

I recognized the same issues as described in #12 This will also validate host names in emails (such as [email protected]). This is because of the stripURLParts call before checking the domain name.

[email protected] will not fail the validation.

Cheers

gohumble avatar Oct 25 '19 13:10 gohumble

Hi, I just stumbled across this enhancement and it is also relevant for me tbh to verify whether I'm working with a valid domain name. Is there any reason not to include this PR into the utils?

jenpet avatar Sep 22 '20 14:09 jenpet

Maintainers seem to be inactive. Better create your own fork or checkout mine. https://github.com/gohumble/go-domain-util

gohumble avatar Sep 25 '20 10:09 gohumble