echo '127.0.0.1 myapp.local' | sudo tee -a /etc/hosts
Map a fake domain to localhost in /etc/hosts
Appends a hosts entry pointing myapp.local at the loopback address, so the domain resolves without DNS. Web apps often require real-looking hostnames for cookies and CORS. Use sudo tee because /etc/hosts needs root, and remove the line when done.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.