The hosts file
.test is a reserved top-level domain that is never public, so Nearhost resolves aliases through /etc/hosts and not through DNS.
The owned block
Section titled “The owned block”Nearhost owns one block and touches nothing else in the file:
# nearhost:start127.0.0.1 myapp.test127.0.0.1 other.test# nearhost:endHow changes are applied
Section titled “How changes are applied”On any alias change, Nearhost computes the desired block in full and applies it with one sudo call. The command reads the aliases from stdin, one per line:
sudo nearhost hosts applyThe helper rewrites only the content between the markers. If the block is absent, it creates it at the end of the file.
Removing it
Section titled “Removing it”Nothing is removed when Nearhost quits. To remove the block, which prompts for sudo:
nearhost hosts clean