LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-09-2010, 12:54 PM   #1
skoinga
Member
 
Registered: May 2010
Posts: 87

Rep: Reputation: 0
bind and cname


Hi,

it's possible to configure a second level zone like this:

Quote:
IN CNAME www.domain2.ext
for example, if I want:

host domain1.ext -> CNAME of www.domain2.ext ?

and NOT only www.domain1.ext -> CNAME of www.domain2.ext ?

Thankyou
 
Old 12-09-2010, 01:05 PM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Greetings!
If you want a CNAME that doesn't rely on a "www." prefix, then just set it up with
"domain1.ext domain2.ext".

You can configure your webserver (example: apache) to answer both "domain1.ext" and "www.domain1.ext" with a rewrite rule.

That way, with your CNAME, and a rewrite rule, you can resolve all four addresses;
www.domain1.ext
domain1.ext
www.domain2.ext
domain2.ext

Last edited by xeleema; 12-09-2010 at 01:07 PM.
 
Old 12-09-2010, 01:37 PM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
it's possible to configure a second level zone like this:

Quote:
IN CNAME www.domain2.ext.
This means that domain1.ext is a CNAME of www.domain2.ext (DON'T forget the trailing dot)
If you want to do this in a wildcard way use:
Code:
   IN CNAME www.domain2.ext.
* IN CNAME www.domain2.ext.
Regards
 
Old 12-10-2010, 01:52 AM   #4
skoinga
Member
 
Registered: May 2010
Posts: 87

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by xeleema View Post
Greetings!
If you want a CNAME that doesn't rely on a "www." prefix, then just set it up with
"domain1.ext domain2.ext".
What I should write in the zone conf?

Quote:
Originally Posted by xeleema View Post
You can configure your webserver (example: apache) to answer both "domain1.ext" and "www.domain1.ext" with a rewrite rule.

That way, with your CNAME, and a rewrite rule, you can resolve all four addresses;
www.domain1.ext
domain1.ext
www.domain2.ext
domain2.ext
Yes ok, I've no problem with apache, only with bind

Thank you very much
 
Old 12-10-2010, 02:59 AM   #5
skoinga
Member
 
Registered: May 2010
Posts: 87

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
This means that domain1.ext is a CNAME of www.domain2.ext (DON'T forget the trailing dot)
If you want to do this in a wildcard way use:
Code:
   IN CNAME www.domain2.ext.
* IN CNAME www.domain2.ext.
Regards
Hi,
I can't use wildcard way. I still need ftp.domain1.ext, pop3.domain1.ext, mail.domain1.ext, etc.. pointing to a different IP.
There is no solution?
 
Old 12-10-2010, 03:11 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,
Quote:
I can't use wildcard way. I still need ftp.domain1.ext, pop3.domain1.ext, mail.domain1.ext, etc.. pointing to a different IP.
You didn't say that in your 1st post. Instead you said that you want everything pointing to www.domain2.ext, at least that it what I've understood:
Quote:
host domain1.ext -> CNAME of www.domain2.ext ?
and NOT only www.domain1.ext -> CNAME of www.domain2.ext ?
Anyway, you can use the DNAME RR to map *.domain1.ext to *.domain2.ext :
Code:
@ DNAME domain2.ext.
Regards
 
Old 12-10-2010, 09:21 AM   #7
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
@skoinga
Quote:
What I should write in the zone conf?
Assuming you already have a CNAME setup, here's what I would suggest;

1) You should have a PTR and an A record for "webserver.domain1.ext" (I'm sure your webserver has a real name)

2) Setup a CNAME for "www.domain2.ext" that points to "webserver.domain1.ext"

From there, you should be able to setup the Apache rewrite rule to redirect any "www.domain1.ext" to "domain1.ext".
You will also need to have a rewrite rule to strip the "www" from "www.domain2.ext".

It's been a long while since I've done this, so all of this is from memory.
If you want more details, this article should help out;
http://www.thesitewizard.com/domain/...-website.shtml

Last edited by xeleema; 12-10-2010 at 09:24 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dns cname abakhiet Linux - Server 3 06-01-2010 03:35 AM
How can i entry a cname? epamuk Linux - Server 4 11-06-2009 02:23 AM
BIND 9 CNAME propagation issue rahmad Linux - Server 5 08-15-2008 02:35 AM
why To Use CNAME record ???? srnerkar1 Linux - Networking 3 12-31-2005 12:24 AM
Bind CNAME Problem CleonII Linux - Software 1 11-01-2005 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration