Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-09-2010, 01:54 PM
|
#1
|
Member
Registered: May 2010
Posts: 87
Rep:
|
bind and cname
Hi,
it's possible to configure a second level zone like this:
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
|
|
|
12-09-2010, 02:05 PM
|
#2
|
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
|
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.
|
|
|
12-09-2010, 02:37 PM
|
#3
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,220
|
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
|
|
|
12-10-2010, 02:52 AM
|
#4
|
Member
Registered: May 2010
Posts: 87
Original Poster
Rep:
|
Quote:
Originally Posted by xeleema
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
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
|
|
|
12-10-2010, 03:59 AM
|
#5
|
Member
Registered: May 2010
Posts: 87
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
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?
|
|
|
12-10-2010, 04:11 AM
|
#6
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,220
|
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:
Anyway, you can use the DNAME RR to map *.domain1.ext to *.domain2.ext :
Code:
@ DNAME domain2.ext.
Regards
|
|
|
12-10-2010, 10:21 AM
|
#7
|
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
|
@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.
|
|
|
All times are GMT -5. The time now is 08:13 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|