5 ms·
> Domain normalization is a bitch I’m a no-www advocate. All my sites can be accessed from the Apex domain. But some people for whatever reason like to prepend
by gravitate 4y ago
> Domain normalization is a bitch
I’m a no-www advocate. All my sites can be accessed from the Apex domain. But some people for whatever reason like to prepend www to my domains, so I wrote a rule in Apache’s .HTACCESS to rewrite the www to the Apex.
Here’s a tutorial for doing that: https://techstream.org/Web-Development/HTACCESS/WWW-to-Non-WWW-and-Non-WWW-to-WWW-redirect-with-HTACCESS https://techstream.org/Web-Development/HTACCESS/WWW-to-Non-W...
- macintux 4y ago25 years ago I added a rule to my employer’s firewall to allow the bare domain to work on our web server. Inbound email immediately broke. I was still very new, and didn’t want to prolong the downtime, so I reverted instead of troubleshooting. A few months after I left, I sent an email to a former co-worker, my replacement, and got the same bounce message. I rang him up and verified that he had just set up the same firewall rule. Been much too long to have any clue now what we did wrong.
- JackMcMack 4y agoYou probably created a cname from the apex to www? This problem still exists today. From https://en.wikipedia.org/wiki/CNAME_record https://en.wikipedia.org/wiki/CNAME_record: "If a CNAME record 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." So if you're looking up the MX record for domain, but happen to find a cname for domain to www.domain , it will follow that and won't find any MX records for www.domain. The correct approach is to create a cname record from www.domain to domain, and have the A record (and MX and other records) on the apex. Most DNS providers have a proprietary workaround to create dns-redirects on the apex (such as AWS Route53 Alias records) and serve them as A records, but those rarely play nice with external resources.
- tux2bsd 4y ago> You probably created a cname from the apex to You can't do that, period. A lot of "cloud" and other GUI interfaces deceive people into thinking it's possible, they just do A record fuckery behind the scenes (clever in it's own right but it causes misunderstanding).
- noizejoy 4y ago> I’m a no-www advocate. I used to feel the same way. — Until the arrival of so many new TLDs. Since then I always use www, because mentioning www.alice.band in a sentence is much more of a hint to a general audience as to what I’m referring to than just alice.band
- gravitate 4y agoI hear you. But a redirect is a good solution in that case.
- noizejoy 4y agoYes it is. I just redirect the other way round, so those ever rarer individuals typing in domains are also served fine on my websites. And also to automatically grab the https. I just find it's ever slightly more "honest" to have the server name I mention, also be the one that's actually being served. -- And that's also because I'm quite annoyed at URL shorteners and all kinds of redirect trickery having being weaponized over the years. So I optimize for honesty and facilitate convenience. But this pretty subtle stuff and I'm not advocating anymore. -- I don't think it's that big of a deal either way and I'm just expressing my little personal vote and priorities on the big Internet. :-) So my post wasn't intended to change your mind, but more as a bit of an alternative view and what made me get there.
- agraddy 4y agoI'm a www advocate and reroute my domains from apex domain to www. When you use an apex domain, you have to use an A record which means if you have a server outage it is going to take time to update the record to point at a new IP address. If you use www with a CNAME, the final server IP can be quickly switched assuming you've set the CNAME and network up for that functionality - you can't do that with an apex domain.
- account42 4y agoThat doesn't make any sense at all - the CNAME just points to somewhere else with an A (and AAAA in $current_year) record. It adds another point you can switch around but doesn't let you switch it any quicker. How quickly you can effectively change what the domain points to is determined by the TTL of the record (withing limits) which can be lowered for any record.
- agraddy 4y agoJust saw this response. In my comment above, I didn't want to spend a lot of time responding to the original post so I handwaved a lot with this "assuming you've set the CNAME and network up for that functionality" When you have a www you ultimately have more flexibility. For example, you can point a CNAME at another CNAME. This answer on ServerFault mentions the additional options (and downsides of doing that): https://serverfault.com/a/223634 https://serverfault.com/a/223634 https://serverfault.com/questions/223560/www-a-record-vs-cname-record https://serverfault.com/questions/223560/www-a-record-vs-cna... Heroku vaguely mentions the benefits under the "Limitations" section of this link: https://devcenter.heroku.com/articles/apex-domains https://devcenter.heroku.com/articles/apex-domains After a DDos attack, they were much more explicit in their recommendations: "We strongly recommend against using root domains. Use a subdomain that can be CNAME aliased to proxy.heroku.com, and avoid ever manually entering IPs into your DNS configuration." https://web.archive.org/web/20110609095616/https://status.heroku.com/incident/156 https://web.archive.org/web/20110609095616/https://status.he... Here is an old post about someone who initially used an apex domain and then had issues (that they hacked around): https://web.archive.org/web/20110718170757/http://blog.y3xz.com/post/3920967238/the-anomaly-of-amazon-ec2-load-balancing https://web.archive.org/web/20110718170757/http://blog.y3xz.... I believe that some larger providers are providing some work arounds which makes it easier to hack around the issue these days, but I still firmly believe that if you set your site up using "www" (even if it is initially an A record - most of mine are A records right now), you will have more flexibility in the long run than if you set your site up on an apex domain.