[GH-ISSUE #33] Breaks Windows hosts file line length rules #16

Closed
opened 2026-03-02 05:09:13 +03:00 by kerem · 3 comments
Owner

Originally created by @ethanclevenger91 on GitHub (Dec 7, 2021).
Original GitHub issue: https://github.com/goodhosts/cli/issues/33

Per https://github.com/goodhosts/vagrant/issues/28, Windows only supports 9 aliases per line in the hosts file. While the specifics of what Windows will or won't support don't seem to be super well documented, I also don't see explicit documented support for multiple aliases per line.

In my experience, too many entries on a single line does prevent aliases further down the line from working.

There may be a need to force each entry onto its own line.

Windows 10 Home, v21H1, OS build 19043.1387

Originally created by @ethanclevenger91 on GitHub (Dec 7, 2021). Original GitHub issue: https://github.com/goodhosts/cli/issues/33 Per https://github.com/goodhosts/vagrant/issues/28, Windows only supports 9 aliases per line in the hosts file. While the specifics of what Windows will or won't support don't seem to be super well documented, I also don't see explicit documented support for multiple aliases per line. In my experience, too many entries on a single line _does_ prevent aliases further down the line from working. There may be a need to force each entry onto its own line. Windows 10 Home, v21H1, OS build 19043.1387
kerem closed this issue 2026-03-02 05:09:13 +03:00
Author
Owner

@luthermonson commented on GitHub (Dec 9, 2021):

We did a bit of that work here: https://github.com/goodhosts/hostsfile/issues/18

We added https://github.com/goodhosts/cli/blob/main/cmd/clean.go#L46 this so you can do a goodhosts clean --hosts-per-line 1 after you write the hosts file. Does that solve your issues? We could set the default to 1 but we all agreed on 9 for the time being.

<!-- gh-comment-id:989416506 --> @luthermonson commented on GitHub (Dec 9, 2021): We did a bit of that work here: https://github.com/goodhosts/hostsfile/issues/18 We added https://github.com/goodhosts/cli/blob/main/cmd/clean.go#L46 this so you can do a `goodhosts clean --hosts-per-line 1` after you write the hosts file. Does that solve your issues? We could set the default to 1 but we all agreed on 9 for the time being.
Author
Owner

@ethanclevenger91 commented on GitHub (Dec 16, 2021):

The context in which I'm using goodhosts is the vagrant plugin, which is not defaulting to 9 at this time (1.1.1) and does not have a config option for hosts per line.

<!-- gh-comment-id:996122988 --> @ethanclevenger91 commented on GitHub (Dec 16, 2021): The context in which I'm using goodhosts is the vagrant plugin, which is not defaulting to 9 at this time (1.1.1) and does not have [a config option for hosts per line](https://github.com/goodhosts/vagrant/blob/main/lib/vagrant-goodhosts/config.rb).
Author
Owner

@luthermonson commented on GitHub (Dec 19, 2021):

https://github.com/goodhosts/vagrant/releases/tag/1.1.2 this should do it for you, closing the issue for now but feel free to reopen if it doesnt do what you need

<!-- gh-comment-id:997437450 --> @luthermonson commented on GitHub (Dec 19, 2021): https://github.com/goodhosts/vagrant/releases/tag/1.1.2 this should do it for you, closing the issue for now but feel free to reopen if it doesnt do what you need
Sign in to join this conversation.
No labels
bug
bug
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cli#16
No description provided.