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. |
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 |
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 |
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? |
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 |
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. |
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 |
All times are GMT -5. The time now is 12:48 PM. |