Skip to content

fix(hostname): correct max hostname length from 255 to 253 characters#76

Merged
tigerwill90 merged 1 commit into
masterfrom
feat/hostname/fix-max-length
Feb 5, 2026
Merged

fix(hostname): correct max hostname length from 255 to 253 characters#76
tigerwill90 merged 1 commit into
masterfrom
feat/hostname/fix-max-length

Conversation

@tigerwill90

@tigerwill90 tigerwill90 commented Feb 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the maximum hostname length validation from 255 to 253 characters per DNS specifications.

Motivation

RFC 1035 specifies that domain names are limited to 255 octets in wire format. However, this includes the length byte of the first label and the terminating zero-length root label byte. The actual maximum length of a hostname as a human-readable string is 253 characters.

Fox was incorrectly using 255 as the limit, which could allow invalid hostnames that would fail in practice.

Changes

  • fox.go: Change hostname length check from 255 to 253
  • fox_test.go: Update test cases to use 253-character hostnames
  • README.md: Correct documentation from "255-character limit" to "253-character limit"

References

@tigerwill90 tigerwill90 merged commit 0b249b3 into master Feb 5, 2026
4 checks passed
@tigerwill90 tigerwill90 deleted the feat/hostname/fix-max-length branch February 5, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants