Solved

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

Posted on 2008-10-20
9
1,305 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

751 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