LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-09-2009, 03:42 AM   #1
albinworld
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Rep: Reputation: 0
Incompatibility between A register and CNAME registers


Using BIND.

I need that Apache catches the request to all possible subdomains, so I configured bind as follows:

* IN A 91.19.19.91

I works, but now I need that two subdomains go to other computers, so I added:

mail.mydomain.tld. CNAME ghs.google.com
mediafiles.mydomain.tld. CNAME mediafiles.mydomain.tld.aws.amazons3.com

but when I request mail.mydomain.tld or mediafiles.mydomain.tld the A register appears to be preferent regard to CNAME registers (order in the zone file seems that no matters) because both request go to 91.19.19.91.

How could I change this behaviour?

Thanks in advance.
 
Old 01-09-2009, 07:15 AM   #2
colonboy
Member
 
Registered: Dec 2005
Location: Prior Lake, MN
Distribution: Fedora, Suse, Mandriva, Ubuntu
Posts: 35

Rep: Reputation: 15
albinworld,

I'm pretty much a noob at this, but I thought a CNAME record is an alias that points to another node with an A record. For example:

thisbox A 192.168.1.1
thatbox CNAME thisbox

meaning that thisbox and thatbox are the same - CNAME just stating that thatbox is just another name (alias) for thisbox.

Just a thought. I'm sure those who are more experienced can have better and more detailed answers.

Good Luck.

Colonboy
 
Old 01-09-2009, 09:09 AM   #3
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
Name Based Virtual Host

I don't like to use 'any' CNAME as having multiple A records with the same IP never hurt anyone but that's just me.

Name based virtual hosts would be your soloution.

http://httpd.apache.org/docs/1.3/vhosts/name-based.html
 
Old 01-10-2009, 09:16 AM   #4
albinworld
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Apache works fine kentyler, it's only a BIND question.

I tryed

mail.mydomain.tld. IN A 74.125.43.121
* IN A 91.19.19.91
mail.mydomain.tld. CNAME ghs.google.com

but problem continues.

I donīt want to have

subdom1.mydomain.tld. IN A 91.19.19.91
subdom2.mydomain.tld. IN A 91.19.19.91
subdom3.mydomain.tld. IN A 91.19.19.91
subdom4.mydomain.tld. IN A 91.19.19.91
...
mail.mydomain.tld. CNAME ghs.google.com

because every time a user gets a new account, my website should update the zone file and restart the BIND and wait until other servers get updated ... doesnīt it?

Last edited by albinworld; 01-11-2009 at 10:15 AM. Reason: dns cname alias
 
Old 01-12-2009, 02:30 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You haven't shown all your DNS conf files/settings, but it sounds like you haven't got a root.hints zone file, so the CNAME alias mail.mydomain.tld. resolves to the 'real name' ghs.google.com (as per colonboy), which then looks to find the IP addr. You've got a wildcard there, so it'll try to use that.
Try these docs:
http://www.linuxtopia.org/online_boo...5_ch-bind.html
http://www.redhat.com/mirrors/LDP/HOWTO/DNS-HOWTO.html
 
Old 01-12-2009, 03:09 PM   #6
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
Ahh I see what you are saying now.


A wildcard dns entry needs to be the last record in the zone file for sure.

Some people ignore wildcard dns entries so use with caution as it's not rfc compliant.
 
Old 01-14-2009, 03:53 AM   #7
albinworld
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
After reading the posted documentation I'm trying to test some changes but something goes wrong.

I did the change two days ago but no-DNS-server has seen the change, and http://www.intodns.com/bodasdigitales.net says that my dns primary server doesnīt respond but http://www.intodns.com/bodasdig.com checks other domain in the same server and BINDS responds good.

You wanted to see all the zone file, here you have. If it works without the wildcard I'll try to put it at the end, but I think that the order doesnīt means. Other test in mind is to add an A record to mail that points to the IP of ghs.google.com

bodasdigitales.net. 86400 IN SOA r14844.ovh.net. webmaster.bodasdigitales.net$
2008120904 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day

IN NS r14844.ovh.net.
IN NS sdns1.ovh.net.

bodasdigitales.net. IN MX 10 aspmx.l.google.com.
bodasdigitales.net. IN MX 20 alt1.aspmx.l.google.com.
bodasdigitales.net. IN MX 20 alt2.aspmx.l.google.com.
bodasdigitales.net. IN MX 30 aspmx2.googlemail.com.
bodasdigitales.net. IN MX 30 aspmx3.googlemail.com.
bodasdigitales.net. IN MX 30 aspmx4.googlemail.com.
bodasdigitales.net. IN MX 30 aspmx5.googlemail.com.


IN A 91.121.51.173

www IN A 91.121.51.173

mail.bodasdigitales.net. IN CNAME ghs.google.com
#mail.bodasdigitales.net. IN A 74.125.43.121

#here is where I had the wildcard
ejemplo1.bodasdigitales.net. IN A 91.121.51.173
ejemplo2.bodasdigitales.net. IN A 91.121.51.173
ejemplo3.bodasdigitales.net. IN A 91.121.51.173
 
  


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 and CNAME noir911 Linux - Server 3 05-06-2008 01:45 PM
How do I set up a CNAME record? SimbaSpirit Linux - Software 1 02-28-2008 07:01 AM
registers strycnine Programming 4 05-17-2007 11:44 AM
CNAME question??? vbtalent Fedora 1 03-15-2006 06:03 AM
why To Use CNAME record ???? srnerkar1 Linux - Networking 3 12-31-2005 12:24 AM

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

All times are GMT -5. The time now is 02:19 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
Open Source Consulting | Domain Registration