Skip to content

Add test to ensure dotted-decimal IPv4 addresses are rejected by format: hostname #838

@VIDIT45AGARWAL

Description

@VIDIT45AGARWAL

The current format-hostname test suite does not include a case ensuring that dotted-decimal IPv4 addresses (e.g., 192.168.0.1) are rejected.
Because hostname labels are allowed to:

  1. start with digits, and
  2. be entirely numeric,

a validator may incorrectly validate 192.168.0.1 as four numeric labels and accept it as a hostname.

However, RFC 1123 section2.1 mentioned in the spec states:
a valid host name can never have the dotted-decimal form #.#.#.#

Image

Therefore, dotted-decimal IPv4 addresses must not be considered valid hostnames.
Since we already provide a separate format: ipv4, allowing such values to pass hostname would blur the distinction between the two formats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions