Hot answers tagged

58

Yes, that's an appropriate use of CNAMEs. In the discussions I've been part of, the arguments tend to go like this: Against CNAMEs: There is a (tiny) performance penalty, as the downstream DNS caches need to perform 2 DNS lookups, one for the CNAME and one for the A-Record the CNAME points to. Vague, bogus arguments about CNAMEs having less "authority" or ...


40

From RFC 1034 - Domain names - concepts and facilities: Of course, by the robustness principle, domain software should not fail when presented with CNAME chains or loops; CNAME chains should be followed and CNAME loops signalled as an error. So yes, it is allowed and properly written software will handle it just OK. CNAME chains aren't however ...


39

It is possible to do this. At one point it was up in the air a bit until 4592 clarified that it should be supported. Just because it is possible doesn't mean it is supported by all DNS providers. For example, GoDaddy won't let you set up a wildcard in a CNAME record. In terms of whether it is advisable or not to do this, it depends on your usage. Usually ...


34

CNAME records were originally created to allow multiple names that provide the same resource to be aliased to a single "canonical name" for the resource. With the advent of name based virtual hosting, it has instead become commonplace to use them as a generic form of IP address aliasing. Unfortunately, most people who come from a web hosting background ...


33

DNS records only map IP addresses to hostnames so in a word, no You could, however, use a hostname configuration in your web server to serve a subdirectory when a request comes in. Like having something.domain.com redirect/equate to somethingelse.domain.com/downhere. That would depend on your web server software, not DNS.


29

The certificate name must match what the user entered in the browser, not the 'final' DNS record. If the user enters docs.tenantcompany.com then your SSL certificate has to cover that. If docs.tenantcompany.com is a CNAME to foo.example.com, the certificate does not need to cover foo.example.com, just docs.tenantcompany.com.


26

Not possible - this would conflict with the SOA- and NS-records at the domain root. From RFC1912 section 2.4: "A CNAME record is not allowed to coexist with any other data."


24

Multiple CNAME records for the same fully-qualified domain name is a violation of the specs for DNS. Some versions of BIND would allow you to do this (some only if you specified the multiple-cnames yes option) and would round-robin load-balance between then but it's not technically legal. There are not supposed to be resource records (RRs) with the same ...


23

According to RFC 1123, the MX record cannot point to a CNAME. If I were in your situation, I would setup mail.ourdomain.com as an A record pointing to the new suppliers IP address and then quickly work on changing all MX records over to the correct data. Then address why changing MX records is so difficult in your organization. That being said, most mail ...


20

Correct, it is a breach of RFC 1034, section 3.6.2, paragraph 3: ... If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different. ... This applies here because the root of your zone must also have SOA and NS records.


20

The windows hosts file supports only ip->name mappings, it does not support any other standard DNS record types. See here: http://technet.microsoft.com/en-us/library/bb727005.aspx#EDAA I would recommend running a simple dns server in order to do the redirect you are talking about. Try powerdns http://www.powerdns.com/


19

No you don't because DNS records don't propagate. What you do need to allow for is for any cached records to expire, based on the TTL of the record in question. If this is a new record, no caching can have occurred so the new record should be available and should resolve immediately. Additionally, the root servers (first level; .) don't host DNS zones or ...


18

There are two ways, both require administrator access or trust to the DNS records: Perform a zone transfer (AXFR) on the domain to retrieve all records for the domain. The DNS administrator needs to explicitly allow AXFR transfers to your IP address from your chosen DNS server. You can perform such a transfer like this: dig @ns1.google.com google.com AXFR ...


17

It would definitely create a problem if you were to point your MX records at CNAME records since it is against the standards. The clearest explanation is provided by RFC2181 §10.3: 10.3. MX and NS records The domain name used as the value of a NS resource record, or part of the value of a MX resource record must not be an alias. Not only is ...


17

Jason's answer is correct. But just to clarify terms a bit here, "DNS redirect" is a bit of a misnomer. DNS has CNAME records (a.k.a. aliases) which is a name pointing to another name. But it's not a redirect. The translation from name to name to IP all happens in the background and your browser only cares about the initial name. The only thing that does ...


16

The actual RFC that defines the NS RR (RFC1035) just says that it's a domain-name without specifying the RR type of the target (though it does make it clear that it can't be an IP). It does get specific mention in RFC1912 though, section 2.4: Having NS records pointing to a CNAME is bad and may conflict badly with current BIND servers. In fact, ...


15

Sure, it is possible. It is generally discouraged though, for the obvious reason that it uses more DNS resources. For example: foo IN CNAME someserver.somehost.com. bar IN CNAME foo Querying 'bar' would result in CNAME foo being queried, then someserver.somehost.com. being queried, resulting in one extra query. For every element in the ...


15

The CNAME should cache for an hour (the alias value), but when the corresponding A is looked up, it will only cache for a total of 1 minute. You're talking about two independent records that are handled separately.


15

so you are not looking at redirection as such (as that happens at the app level ie on apache/nginx/wherever) but rather on the DNS resolution - host on which DomainA is hosted will or should never be hit - based on your description as you want the DNS requests to be resolved to the IPs of the DomainB. Unless I'm missing something in your request ? As Shane ...


14

If I'm not mistaken, the problem is that your registrar has published DS records for your domain - that is, DNSSEC signing keys: [me@risby player]$ dig ds ultreyatours.com [...] ;; ANSWER SECTION: ultreyatours.com. 85920 IN DS 49864 8 1 0152C1213569799FAFA42C7699A20132A293F908 ultreyatours.com. 85920 IN DS 20536 8 1 ...


14

Firstly, the underlying reason is not that you must use an A record, but that you cannot use a CNAME record because those cannot coexist with other normal resource record types. The reason for that restriction is in §3.6.2 of RFC 1034: If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical ...


13

Simplified version: A records point to IP addresses. CNAME's point to other A records. You could use an A record, but for this you should have a highly available IP address for your EC2 instance. Amazon calls this product "Elastic IP Addresses". If you set up a CNAME to an A record that Amazon manages, then Amazon has control over a layer of indirection. ...


13

After a lot of work and research here, I have found an acceptable solution. First, it is important that we all follow the RFCs. I patched my DNS server to violate the RFC, and I discovered that several other major DNS servers would not respect the change. The appropriate move is to put the MX on the host that the CNAME points to. So, if ...


13

I added the line *.www IN CNAME my_webserver to my zone file in my bind config and that worked perfectly (ie. whatever.www.domain.com and whatever2.www.domain.com all pointed to my_webserver. It was also possible to to add exceptions to this by adding the line exception.www IN CNAME another_server so that ...


13

Unfortunately, what you're running into is a limitation of the DNS specification. Having an MX record for the same hostname as is defined as a CNAME record will fail in most DNS server implementations. Some older DNS servers will allow this, but they have been mostly phased out in favor of newer, more secure implementations. Instead of using CNAME ...


13

Per Farseeker's answer, yes, this is what CNAME records are for. However whilst you can use this to point www.example.net to www.example.com, you can't use it to point example.net on its own (i.e. without the www prefix) to something else. This is because example.net must also have an SOA record and NS records, and it's not legal in DNS to have a CNAME ...


12

Amazon is aware of the problem with root domains and the Elastic Load Balancer. They recommend this workaround: Configure the root domain to a service that redirects mydomain.com to www.mydomain.com (or any other subdomain of your choice) Set up a CNAME record that maps the load balancer DNS name to "www.mydomain.com". I don't like this solution, but is ...


12

The answer to your question will depend on the URLs you want your users to use. If you want users to access your application via http://app.domain.com/ or http://www.domain.com/ you can either use an A record to point app or www to the IP address of the application server, or add a CNAME record to point to the real name of the app server. ...


12

In BIND, the wildcard matches when another record does not exist. See http://en.wikipedia.org/wiki/Wildcard_DNS_record.


11

AFAIK there is nothing special to it. In your public DNS just create "your-name.your-domain.com" as a CNAME to "your-bucket-name.s3.amazonaws.com" and have the folder name match your domain name. CNAME record for my Amazon S3 domain, so have nicer URLs I assume you have your website hosted elsewhere. Inside the HTML there are links to images, videos ...



Only top voted, non community-wiki answers of a minimum length are eligible