Hi All!

I have this local debian server and I'm trying to add subdomains to it.

I only access it using its IP, but I edited the host file of my pc to access it using testwebsite.com and now I want to add subdomains. Each subdomain should be able to access different projects. For example the main domain (maindom.com) should be able to access /var/www/. Subdomain subone.com should be able to access /var/www/subone/, and subdomain subtwo.com should be able to access /var/www/subtwo/.

Is bind9 really needed?
Thanks in advance.

Recommended Answers

All 2 Replies

BIND nor any other DNS server service isn't required if you simply want to resolve a few hostnames from a single PC. You can simply continue to add these hostnames to your PC's hosts file. All of these hostnames will map to the same IP address.

If the target server is a web server, how you route the request is dependent on the web server app, not on a DNS server service.

I was trying to use VirtualHosts to access the subfolders for the subdomains. I tried the VirtualHosts in my local using apache and they worked. But when I tried the virtualhosts in the server, It won't work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.