Skip to content

localhost and localhost. are valid domains, but give ValidationFailure #185

Closed

Description

@milahu
import validators
validators.domain('localhost') # -> ValidationFailure
validators.domain('localhost.') # -> ValidationFailure

refs

edit: or does 'domain' mean 'fully qualified domain name'? (fqdn)
then 'localhost' is invalid

Activity

  1. stevecj commented on Jun 23, 2021

    @stevecj

    Regardless of the intention of this method with regard to local vs Internet domains, it would be very nice to have a way to specify what is desired. Either additional validation functions or additional arguments to say whether names without any dot separators should be valid and whether IPv4 addresses should be valid and whether IPv6 addresses should be valid.

  2. blakev commented on Nov 23, 2021

    @blakev

    @stevecj makes a good point. The url validation function doesn't work as expected.

  3. nandgator commented on Mar 2, 2023

    @nandgator
    Collaborator

    related: #142

  4. added a commit that references this issue on Mar 14, 2023
    0daa303
  5. aaronkurz commented on Mar 17, 2025

    @aaronkurz

    @yozachar So localhost is not seen as a valid domain I suppose?

  6. nandgator commented on Mar 17, 2025

    @nandgator
    Collaborator

    @yozachar So localhost is not seen as a valid domain I suppose?

    No, but a valid simple hostname.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssue/PR: RedundantenhancementIssue/PR: A new featureoutdatedIssue/PR: Open for more than 3 months

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions