Developing offline
Out of the box, Lando uses an external server to route pretty domain names back to your localhost to provide convenient proxying. This method is minimally invasive and doesn't require Lando to alter your machine's DNS routing. This has the downside of requiring an internet connection to access your sites.
You may want the freedom of hacking away on your site while scaling Everest or just to simply route your projects to a different top level domain, like *.dev
, *.hanshotfirst
or *.test
. However, *.dev
is not recommended because it is a Google-owned TLD.
To enable offline custom TLD goodness, we'll use DNSMasq to route traffic to our local system and add a single config line to our global Lando config to direct lando to use that TLD for our sites.
Mac Specific Instructions
- Ensure you've installed Homebrew.
- Install DNSMasq:
brew install dnsmasq
- Follow the instructions in the output of
brew info dnsmasq
- Add the following line to your
/usr/local/etc/dnsmasq.conf
file:
Sub in your favorite TLD for 'test' here if you want to use something more flashy.address=/test/127.0.0.1
- Restart DNSMasq:
brew services restart dnsmasq
- For OS X to resolve requests from *.test to localhost we need to add a resolver:
sudo mkdir -p /etc/resolver sudo nano /etc/resolver/test
- Add the following line to the test file resolver in /etc/resolver/.
nameserver 127.0.0.1
- Reboot OS X to enable the new resolver.
- Flush your DNS, just to be sure that your browsers use the new dns
directives.
sudo dscacheutil -flushcache sudo killall -HUP mDNSResponder
- Open your
~/.lando/config.yml
file and add the following line:
Again, allow your creativity to flourish and use whatever TLD makes you smile.domain: test.me
- Power Lando down with
lando poweroff
- Start up your favorite Lando app to test it out with
lando start
from within your app's root directory. You should see something like:
BOOMSHAKALAKA!!!
Your app has started up correctly.
Here are some vitals:
NAME bestappever
LOCATION /Users/McFly/timemachines/bestappever
SERVICES appserver, nginx, database, cache, node
APPSERVER URLS https://localhost:32791
http://localhost:32792
http://bestappever.test
https://bestappever.test
- Load it up in the browser and confirm everything is happy and working.
Enjoy your signature top level domain while you hack away in complete wifi-less splendor.
Additional Reading
Guides and Tutorials
- Updating your Landofiles to 3.0.0-rc.2+
- Accessing Your Services Externally
- Accessing Lando from Other Devices
- Exporting Databases
- Importing Databases
- Killer D8 Workflow with Platform.sh
- Lando + PhpStorm + Xdebug
- Offline Development
- Using $LANDO_INFO
- Using NodeJS Frontend Tooling
- Using Lando in Visual Studio Code
- Climbing a mountain for love
Advanced Usage
- CLI
- Landofiles
- Environment
- Events
- Networking
- Proxy
- Recipes
- Services
- Tooling
- SSH Keys
- SSL/TLS
- Shared Files
- Global Config
Known Issues
- DNS Rebinding Protection
- File Uploads on Windows
- File Syncing Stalled
- Running VB and HyperV
- Running behind a proxy
- Switching Database Config