Results 1 to 10 of 10
-
01-02-2007, 04:35 PM #1Newbie
- Join Date
- Mar 2005
- Posts
- 10
DNS / Bind problem - easiest method to redirect a domain to another?
Hey folks,
I've got two domains (for sake of example, domain A and domain B). Domain A resolves correctly to my web server. Domain B is just sitting collecting dust. I didn't set these domains up, a previous programmer at my job did.
How do I configure resolv.conf, named.conf and the zone file(s) correctly to have domain B redirect to domain A?
I've already set up httpd.conf so that any requests for the host name of domain A will redirect.
e.g. http://www.domainB.com -> http://www.domainA.com
I just need the DNS part of this fixed (that I'm a bit of a noob at).
Do I have to do something like this in named.conf:
Code:zone "domaina.com" { type master; file "/var/named/domaina.com.hosts"; }; zone "domainb.com" { type master; file "/var/named/domaina.com.hosts"; };
Code:domainb.com. IN CNAME domaina.com.
Thanks if ya can help. ;-)
-
01-02-2007, 04:40 PM #2Web Hosting Evangelist
- Join Date
- Jun 2004
- Posts
- 525
Even if domaina is pointing at domainb via a DNS record if your webserver is not configured correctly to display domainb it won't work.
You will need to ensure the virtual host is setup correctly on your webserver.System Administrator
-
01-02-2007, 04:41 PM #3Newbie
- Join Date
- Mar 2005
- Posts
- 10
I've handled the virtual host part in httpd.conf, that much I'm familiar with. It's the DNS part I'm confused at.
-
01-02-2007, 04:51 PM #4Web Hosting Evangelist
- Join Date
- Jun 2004
- Posts
- 525
domainb.com. IN CNAME domaina.com.
Would point domainb to whichever IP address domaina points to.
If the virtual host setup is done correctly this should work.System Administrator
-
01-02-2007, 05:24 PM #5Newbie
- Join Date
- Mar 2005
- Posts
- 10
Well I tried that, and it didn't work--or at least I think.
nslookup isn't yielding any results at least on my domainb.
-
01-02-2007, 05:35 PM #6Web Hosting Evangelist
- Join Date
- Jun 2004
- Posts
- 525
Try reloading bind.
If you don't have access to the DNS server its most likely that the record will take some time to update and propigate to your ISP's DNS server.
Also try flushing dns. Via a windows command prompt enter "ipconfig /flushdns"System Administrator
-
01-02-2007, 05:56 PM #7Junior Guru Wannabe
- Join Date
- Dec 2006
- Posts
- 38
Double check that domainB is current and has the correct NS1 and NS2. I am sure you have covered that though.
Caro.Net: Support is everything
Offering High Quality Dedicated Servers.
-
01-02-2007, 06:09 PM #8Newbie
- Join Date
- Mar 2005
- Posts
- 10
The domainb nameservers from the registrar are pointing to domaina nameserver (e.g. ns1.domaina.com, ns2.domaina.com).
A lookup on domainb right now gives:
Code:nslookup <domainb> Server: 127.0.0.1 Address: 127.0.0.1#53 ** server can't find <domainb>: SERVFAIL
Hrm..
(dedicated server is Linux btw, that Bind is on)
-
01-02-2007, 06:23 PM #9WHT Addict
- Join Date
- Aug 2005
- Location
- Los Angeles, CA
- Posts
- 169
Originally Posted by velocd
(If I had to guess, I'd say that the problem is that you used the same zonefile for both domains, and the zonefile has the zone name hardcoded into it. The domainb.com zonefile must not say "domaina.com" on the left side of any records. Fix it by copying the zonefile and changing "domaina.com" to "domainb.com" as appropriate.)
-
01-02-2007, 07:34 PM #10Newbie
- Join Date
- Mar 2005
- Posts
- 10
Figured it out, had to do the second method or waht gevg mentioned and put it in its own zone file.
Thanks all. =)