Solved

DNS - How to  use CNAMES to redirect from  domain.org to domain.net?

Posted on 2008-10-20
9
1,308 Views
Last Modified: 2013-12-23
Using Bind 8.1.2 on Solaris.  I want example.net to resolve to example.org.  I have a stanza for both domains in named.conf.  Below are my sample zone files.
1. Are my zone files setup correctly?
If not.
2. What zone file should the cname record be in, example.net or example.org or both?  I have it in example.net.
3. What else do I need to add to which respective zone file to make example.net resolve to example.org?
4. Is there a link that has examples of zone files that explains how to resolve from one domain to another?  
5. Is the setup different in Bind 9.4.2? Use  DNAME instead of CNAME? If so, example please.

; NAMED Configuration for example.org Domain
;
example.org.      IN      SOA       gk.example.org postmaster.example.org. (
                              22      ;serial
                              3600      ; refresh
                              300      ; retry
                              604800      ; expire
                              3600  )      ; minimum
;
;name servers
;
                  IN      NS      gk.example.org.
                  
;

                  IN      A      63.78.97.78
;
                  
$ORIGIN      example.org.
;
www                  IN      A      63.78.97.78  

==================================================================================

; NAMED Configuration for www.example.net Domain
;
example.net.      IN      SOA       gk.example.org. postmaster.example.org. (
                              34            ;serial
                              3600        ; refresh
                              300            ; retry
                              604800      ; expire
                              3600  )      ; minimum
;
;name servers
;
                  IN      NS      gk.example.org.
                  
;
;
                  IN      A      63.78.97.78
$ORIGIN      example.net.
;
;               Aliases
www.example.net.       IN      CNAME      www.example.org.

0
Comment
Question by:Westez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
9 Comments
 
LVL 5

Expert Comment

by:ifreq
ID: 22762705
Greetings,

Your zone-files are almost right. Change this:

$ORIGIN      example.net.
;
;               Aliases
www.example.net.       IN      CNAME      www.example.org.

To this:

$ORIGIN      example.net.
;
;               Aliases
www                              IN      CNAME      www.example.org.

Also remember to configure your www.example.org (www-server to accept traffic from www.example.net-domain). On Apache they are called as VirtualHosts.

0
 
LVL 19

Expert Comment

by:bevhost
ID: 22764443
ifreq:  I don't see how that will make any difference

I would recommend against CNAMEs unless the IP Address changes often.
You might as well use A records instead.
CONS:
It just means that you have to update all the A records if the IP changes.
PROS:
Resolvers don't need to do two lookups to get the answer.

0
 
LVL 19

Accepted Solution

by:
bevhost earned 250 total points
ID: 22764447
I believe that your zone files need no changes.  BUT as ifreq says you may need to configure the web server to accept both names.
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 5

Assisted Solution

by:ifreq
ifreq earned 250 total points
ID: 22765065
bevhost, I didnt say that changing zonefile would make any change. But It would be configured same way
as the 1st domain. Its just for the looks. :-)
0
 

Author Comment

by:Westez
ID: 22767560
All - Clarify this  point for me.
You can create an A record using the same ip address in the two different zone files rather than using the CNAME record in one of the zone files and get the same results?

Configure the web server to accept both names?  We use IIS, wouldn't you set this up by using the host headers method?

We host the primary name server in house, gk.example.org.  An outside vendor hosts the secondary's.
We're authoritive for 30 domains.  When I take the primary of out of play by stopping named on it. I have 6 domains that name resolution fails on, otherwise they all work with named running on the primary.  All of them have the CNAME record line, hence my questions on whether I have my zone fles set up correctly.  
Now I'm wondering if the problem is not on the secondary's.  Like maybe they don't have a stanza in the named.conf file for example.net.







0
 
LVL 19

Expert Comment

by:bevhost
ID: 22772267
You get a better result by using two A records because for each domain only one lookup is required.
A CNAME tells the resolver to lookup the answer in a new location, therefore requiring two lookups.

The Host Headers option is required when the two (different) websites share the same IP address.  If the same web site has two names then host headers are not needed and both can reside in the default web site, in which case the names don't need to be configured on the web server.

I'm not sure about stanza's, but I did find this
http://docs.hp.com/en/B2355-90137/ch05s06.html


0
 

Author Comment

by:Westez
ID: 22780022
How do you configure IIS and Apache to accept both names?  

0
 
LVL 5

Expert Comment

by:ifreq
ID: 22780835
On Apache you make two separate Virtual Hosts entries, like this:

<VirtualHost *:80>
 DocumentRoot /var/www/html
 ServerName www.example.net
</VirtualHost>

<VirtualHost *:80>
 DocumentRoot /var/www/html
 ServerName www.example.org
</VirtualHost>

Notice both pointing to same directory.

0
 

Author Comment

by:Westez
ID: 22798232
I don't know much about Apache.  Is this a requirement for Apache to accept answers for both domain names.  I thought that once the private dns server resolved the name to an ip address it would just send the packet on to it's destination.  Once it arrived the web server would process it.  I'm using IIS, and I don't use host headers so I have an ip address for each site and at the firewall it's static nat.  So it's a one public to one private ip address relationship.  There's always more than one way to do these things, but this is the way I've been taught.  Hence my question on Apache, I'm always interested in learning new ways to do things and how others out there are doing them.
0

Featured Post

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question