lokl dns
Manage /etc/hosts entries for custom domains.
Commands
Section titled “Commands”dns setup
Section titled “dns setup”Add DNS entries for your configured domains.
sudo lokl dns setupThis adds entries like:
# lokl:my-project127.0.0.1 myproject.dev127.0.0.1 app.myproject.dev127.0.0.1 api.myproject.dev# lokl:my-project:enddns remove
Section titled “dns remove”Remove DNS entries.
sudo lokl dns removeAfter removal, flush your DNS cache:
macOS:
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponderLinux:
sudo systemd-resolve --flush-cachesWhy sudo?
Section titled “Why sudo?”Modifying /etc/hosts requires root privileges. lokl only touches entries within its own markers (# lokl:project-name).