LinuxQuestions.org
Visit the LQ Articles and Editorials section
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, 01: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, 02: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: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
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 02:07 PM.
 
Old 12-09-2010, 02:37 PM   #3
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
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, 02: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, 03: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, 04:11 AM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,975

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
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, 10: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: 987
Blog Entries: 4

Rep: Reputation: 252Reputation: 252Reputation: 252
@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 10:24 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:35 AM
How can i entry a cname? epamuk Linux - Server 4 11-06-2009 03:23 AM
BIND 9 CNAME propagation issue rahmad Linux - Server 5 08-15-2008 03:35 AM
why To Use CNAME record ???? srnerkar1 Linux - Networking 3 12-31-2005 01:24 AM
Bind CNAME Problem CleonII Linux - Software 1 11-01-2005 10:27 AM


All times are GMT -5. The time now is 06:36 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration