Solved

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

Posted on 2008-10-20
9
1,298 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
  • 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Stuck in INIT/DROTHER 2 50
Windows DNS Server Caching 3 41
FTP Transfer Speeds ... 6 53
domian network access 5 20
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

861 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