magicLAMP has a built-in DNS resolver which will automatically resolve a number of
.localhost domains to the appropriate magicLAMP container.
Simply change the DNS resolver on your host machine to
For Windows users, go to your Network Settings and update
DNS field with
IPv4 protocol on the
vEthernet (WSL) adapter.
Automatic PHP version resolution
The most notable use Auto DNS is resolving your projects to the appropriate PHP version.
You can suffix your project name with
.[version].localhost, and it will be resolved
to the correct php-fpm container based on the PHP version you specified in the URL.
project.74.localhost will be resolved to the nginx container, which
will interpret the PHP version (7.4 in this case) and execute your PHP code using the
correct PHP version.
nginx will try to find your project's document root in the directory specified in the
PROJECTS_DIR variable inside your
.env file. It will use the
public subdirectory in your project folder as the document root.