![]() |
dns need zone file to resolve virtual host ?
hello to all
how do i resolve virtual hosts using dns ? please help me. thanks in advance. |
In order to answer your question, I will first need to know some more about exactly what you see as the problem.
1. I assume that when you ask about a virtual host, you mean a virtual web server, hosted on either your (Linux?) computer or on a hosting service machine. Is that true? 2. In the configuration for such a web server, you probably have something like this: Code:
<VirtualHost 192.168.1.5:80>If you need more detail about any of this, or if some of my assumptions are wrong, feel free to post again, with more specifics. |
Thanks, you assumptions was right.
i have couple of doubts. my zone file. $84600 @ IN SOA ns1.example.com. root.Server1.example.com. ( 10 ; serial 1800 ; refresh 900 ; retry 69120 ; expire 1080) ; negative cache ttl NS ns1.example.com. NS ns2.example.com. ns1 IN A 192.168.0.1 ns2 IN A 192.168.0.2 Server1 IN A 192.168.0.3 www IN A 192.168.0.3 IN A 192.168.0.2 here the origin is example.com, please give me the example to add another fqdn. and my /etc/resolve.conf search ns1.example.com example.com nameserver 192.168.0.1 nameserver 192.168.0.2 how do i modify this ? thanks in advance. |
To change this to a different domain, you would change example.com. to fu.bar. everywhere it appears in the zone file.
Code:
$84600Code:
zone "fu.bar" {Code:
search fu.bar |
NO NO....
I want to include fu.bar,example.com(multiple sites in single host with single ip). My example is working perfectly with fqdn www.example.com. but i want to add more fqdns in Server1 as virtual hosts. Should i create zone file for each fqdns? if so how do i change the /etc/resolve.conf? thanks in advance |
hello dkm999,
My problem is almost solved, i don't know this way is correct or wrong,please help me to sure it. i just added zone file for each virtual host to ns1, ns2 and modified all the related files accordingly. but i have more doubts. At present the main site is www.example.com, insteaded of that below i added three virtual hosts www.test1.com,www.test2.com,www.test3.com. shell#lynx www.example.com o/p is www.test1.com shell#lynx www.test1.com o/p is www.test1.com rest is coming correctly. why www.example is not showing? should i change the port 80? In the virtual host directive i added ServerAlias www.test11.com (in www.test1.com virtual host) now how do i get this alias site using dns? or how do i modify the zone file? should i again add zone file for this alias site like virtual host? i don't know . please please ... help me. thanks in advance |
You do indeed need to declare a zone file for each of these domains, but I recommend that you use a template, which declares the primary zone nameservers as its own, so that you don't have to make up a new zone file for each of these domains. The template zone file looks like this:
Code:
$84600Code:
zone "test1.com" {I do not recommend using the ServerAlias directive in your server configuration files; it will probably just increase the confusion. Do you have a <VirtualHost> block defined for example.com? Once you start using virtual hosts, the httpd (or apache2) daemon will not notice your main configuration any more; you have to have a virtual host defined for each one you want. And if the daemon cannot find a virtual host that matches the name you used to get there, it will choose the first virtual host defined in your config file, and serve up a page from there. Hope this helps |
Thank you for your excellant explanation.
|
| All times are GMT -5. The time now is 11:54 PM. |