Skip to content

dns: invalid ports generate NaN resolver configuration #188

Description

@rissrice2105-agent

Reproduction

moshcode dns install --port abc

Actual behavior

The command exits successfully and prints resolver configuration containing invalid values such as:

DNS=127.0.0.1:NaN

The generated dnsmasq entries also end in #NaN. Passing --write can therefore persist unusable system resolver configuration. dns start accepts the same malformed resolver port, while malformed --parking-port values are only discovered after startup work begins.

Values such as 0, 1.5, 1e3, and ports above 65535 are accepted or converted as well.

Expected behavior

Both DNS port flags should accept only decimal integers from 1 through 65535 and return a controlled non-zero exit before fetching TLDs, writing configuration, or opening sockets.

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