Validates fully-qualified domain names against RFC 1123, so that they are acceptable to modern bowsers


Keywords
fqdn, domain, hostname, RFC3686, dns, python, python2, python3, rfc-1035, rfc-1123, rfc-2181, rfc-3986, validation
License
MPL-2.0
Install
pip install fqdn==1.5.0

Documentation

Fully-Qualified Domain Names

Build Status Coverage Status Latest PyPI Version

Validates a fully-qualified domain name (FQDN), in full compliance with RFC 1035 <https://tools.ietf.org/html/rfc1035>, and the "preferred form" specified in RFC 3696 section 2.

Can also convert between absolute and relative FQDNs.

from fqdn import FQDN


domain = 'bbc.co.uk'
fqdn = FQDN(domain)

fqdn.is_valid
# True

fqdn.is_valid_absolute
# False

fqdn.is_valid_relative
# True

fqdn.absolute
# bbc.co.uk.