Warm tip: This article is reproduced from serverfault.com, please click

How to enter a custom address to a dns file?

发布于 2020-11-28 12:18:39

in the /var/www/html directory I have many folders which contain websites like 'store/', and to access a website through my LAN I enter in the address bar 'myserveripaddress/store'.

I created a DNS file to access the website with a custom name but I don't know what to put in the file, I tried:

customname    A    myserveripaddress/store

but it didn't work, the only one that works is:

customname    A    serveripaddress

but it doesn't take me to the website under 'store/' directory for example.

Is there a solution?

Questioner
Medling
Viewed
0
Tomek Klas 2020-11-29 00:00:50

DNS does not work this way. In this instance, DNS points domain at a server, but it is to the server how it responds to that request.

to get this to work, you would need to create separate web server configs for each of the "sub-websites" and then point the DNS record at domain name listed in that config.