Skip to content

domain validator fails for fully qualified ("absolute") domain names #124

Description

@mschiffm
>>> import validators
>>> validators.domain('foo.com')
True
>>> validators.domain('foo.com.')
ValidationFailure(func=domain, args={'value': 'foo.com.'})
>>>

Reference: https://tools.ietf.org/html/rfc1034

When a user needs to type a domain name, the length of each label is
omitted and the labels are separated by dots ("."). Since a complete
domain name ends with the root label, this leads to a printed form which
ends in a dot. We use this property to distinguish between:

  • a character string which represents a complete domain name
    (often called "absolute"). For example, "poneria.ISI.EDU."

  • a character string that represents the starting labels of a
    domain name which is incomplete, and should be completed by
    local software using knowledge of the local domain (often
    called "relative"). For example, "poneria" used in the
    ISI.EDU domain.

Discussion: http://www.dns-sd.org/trailingdotsindomainnames.html

Activity

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

    enhancementIssue/PR: A new feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions