Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

RoyGoode's avatar

how to configure dns for domain and subdomain?

i have a fresh ubuntu 20.04 with LEMP, now my website is live with server IP address,how to set DNS for my domain? like : dev1.testdevmaster.com and dev2.testdevmaster.com

hostname is : devmaster.testdevmaster.com

dnsdomainname is : testdevmaster.com

i set new VPS and enable it in nginx sites-available :

server {
    listen 80;

    root /var/www/testdevmaster/public;
    index index.php index.html index.htm;

    server_name (my-server-ip-address);

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
   
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }

now when i change the IP address form server_name to my domian(testdevmaster.com)

This page isn’t working (my-server-ip-address) didn’t send any data in chrome.

but with my-server-ip-address i can see laravel error 500. I also have a download host that needs to connect to my subdomain(dl.testdevmaster.com) What should I do now?

0 likes
1 reply
ElwinB's avatar

The question is a bit unclear,

Do you want to be able to access this domain from your local computer, and it is on the internet? (with a valid domain name and DNS settings set??)

OR?

If so, you need to add the line:

server_name *.testdevmaster.com testdevmaster.com;

Please or to participate in this conversation.