News for hackers. Stuff that matters.
Re:Should you use www or not in your domain? (2017) by crazygringo on Sunday November 11, 2018 @10:12AM (#18426707)
The reasons given for using www are honestly very weak, just edge cases really.

As far as cookies are concerned, keeping them on the origin ensures they get passed to all subdomains, which is usually a benefit, as opposed to a problem -- which you'll discover when you need to restrict API requests on a subdomain only to logged-in users, for example. And as long as you're keeping your cookie payload small, like a session ID or two, there's zero worry about a performance hit.

And as far as a CNAME needing to point to another domain instead of an IP, has that ever been an issue for anyone? Genuinely curious. I'd never even heard of that until now.

Honestly, simpler is better and "www." is an unnecessary vestige from another era. I dropped it from my sites starting a couple years ago. (Obviously with a redirect in case anyone ever types it.)

Re:Should you use www or not in your domain? (2017) by calibas on Sunday November 11, 2018 @11:32AM (#18427152)
Sending session tokens to every subdomain, and also potentially leaking other sensitive data, is a pretty strong case in my opinion.

Of course, this isn't something that has a concrete right and wrong answer. It's more a question of how much you trust your subdomains. Personally, I think sharing that information should be a conscious choice when setting the cookies and not something that you let happen by default.

Re:Should you use www or not in your domain? (2017) by SlowRobotAhead on Sunday November 11, 2018 @08:59PM (#18430052)
I agree. It doesn’t exactly seem like edge cases to not want to propagate front end cookies to internal services. IDK, seems like an issue with cookies just as much as www or no-www.
Re:Should you use www or not in your domain? (2017) by ericpauley on Sunday November 11, 2018 @10:25AM (#18426767)
CNAME is absolutely an issue, especially when using managed hosting. Many hosts require that you CNAME since they move around IPs. (e.g. Heroku) so unless you put a provider in front of them that integrates with your DNS you need www.
Re:Should you use www or not in your domain? (2017) by hacknat on Sunday November 11, 2018 @10:38AM (#18426843)
You can add AWS, Azure, and GCP to this list. Most people don’t want to lay out the money for a static IP, and why should they?
Re:Should you use www or not in your domain? (2017) by yegle on Sunday November 11, 2018 @11:17AM (#18427070)
Not true for App Engine: we have a fixed set of IP addresses to be used in A/AAAA record.

Disclaimer I work on App Engine.

Re:Should you use www or not in your domain? (2017) by hacknat on Sunday November 11, 2018 @11:54AM (#18427251)
This FAQ on App Engine specifically says you guys can’t map a static IP to a site:

https://cloud.google.com/appengine/kb/

Re:Should you use www or not in your domain? (2017) by stickfigure on Sunday November 11, 2018 @12:41PM (#18427512)
That is something different. If you want to run your app on a naked domain, they give you a set of A/AAA records you can use.

Search in that same document for "naked domain".

Re:Should you use www or not in your domain? (2017) by merb on Sunday November 11, 2018 @01:15PM (#18427679)
you should read before you write.

> I'd like to map my app to a naked domain (such as http://example.com).

vs.

> App Engine does not currently provide a way to map static IP addresses to an application

the latter is that you own an IP and want to map it against your appengine.

the former is example.com -> appengine site.

(not related to google)

Re:Should you use www or not in your domain? (2017) by gray_-_wolf on Sunday November 11, 2018 @11:39AM (#18427184)
We solved this by having cloudflare manage our dns and they offer something like "cname to ip".
Re:Should you use www or not in your domain? (2017) by TheRealPomax on Sunday November 11, 2018 @01:53PM (#18427872)
You sidestepped it, rather than really solved it: you got rid of the CNAME issue by trading it for a proxy availability issue. It works--of course it works, it's literally why cloudflare exists--but now your service availability is directly tied to cloudflare's availability. And cloudflare glitches often enough that plenty of people run into their 5xx pages on a daily basis across the web.

So you traded an intermittent problem (only relevant when an IP change occurs) for 24/7 guaranteed service outages for a (probably very) low percentage of your intended demographic.

Re:Should you use www or not in your domain? (2017) by hamandcheese on Sunday November 11, 2018 @03:03PM (#18428252)
Cloudflare provides CNAME flattening without enabling Cloudflare CDN on a domain, so you only have to be dependent on their DNS infrastructure, not their CDN/proxying infrastructure.
Re:Should you use www or not in your domain? (2017) by Dylan16807 on Sunday November 11, 2018 @02:10PM (#18427946)
"Now your service availability is tied to your DNS service's availability" is always true.
Re:Should you use www or not in your domain? (2017) by TheRealPomax on Tuesday November 13, 2018 @09:18PM (#18446879)
Would you like me to edit it so it says "Now your service availability is tied to not just the global DNS system that literally anything that wants to exist on the web with not just an IP but a named host relies on, but a secondary routing entity that sits on top of standard DNS and does fancy things"?

Because I'm pretty sure we all know what I meant when I pointed out using Cloudflare means gaining a convenience at the expense of being at the mercy of third party outages.

Re:Should you use www or not in your domain? (2017) by amingilani on Sunday November 11, 2018 @04:03PM (#18428578)
For pretty much any DNS service you use.
Re:Should you use www or not in your domain? (2017) by scoggs on Sunday November 11, 2018 @02:25PM (#18428044)
It could just be a stopgap in the meantime while they write the true solution? Just a thought.
Re:Should you use www or not in your domain? (2017) by koolba on Sunday November 11, 2018 @10:43AM (#18426882)
Cookies can be scoped to a parent domain. So www.example.com can scope it’s cookies to example.com and have them accessible to api.example.com.
Re:Should you use www or not in your domain? (2017) by erikpukinskis on Sunday November 11, 2018 @01:37PM (#18427789)
Edge cases are good reasons.

In some cases a single edge case can be the reason to make a decision.

If your attitude is “working in 99% of cases is good enough”, that means over a long enough period of use, 100% of your users will encounter an edge failure.

The way to even have a shot at 99% of your users a good experience is to constantly let edge cases force your hand.

Re:Should you use www or not in your domain? (2017) by fwip on Sunday November 11, 2018 @01:41PM (#18427807)
Only if edge cases are uniformly distributed, which is rarely the case.
Re:Should you use www or not in your domain? (2017) by erikpukinskis on Monday November 12, 2018 @12:05AM (#18430706)
No, they needn't be uniform.
Re:Should you use www or not in your domain? (2017) by toast0 on Sunday November 11, 2018 @11:41AM (#18427192)
If you plan to use a CDN in front of your site at the Apex, it severely constrains your options. You either need to pick a CDN that only uses anycast, so you can plop in a staticy A record, or you need to delegate your domain to their nameservers so they can send different resolvers different records. Those aren't necessarily bad options, but it leaves out a lot of CDNs that either don't do anycast or do a mix of anycast and unicast, and it leaves out the possibility of using geodns to use one CDN in one region and another in other reasons.

I'm a bit scale focused though. If your site is never going to need a CDN, you can of course pick aesthetics over serviceability. But if this is something you hope to one day get big, you might as well make an easy decision to prepare for it at the start. You will want to support any inbound links you get for as long of forever as possible, so it's nice if they are to the right hostname to start with.

Re:Should you use www or not in your domain? (2017) by justinph on Sunday November 11, 2018 @02:41PM (#18428134)
If you run a high traffic website with geographic redundancy, being able to quickly switch your DNS is essential.
Re:Should you use www or not in your domain? (2017) by Audible_logic on Sunday November 11, 2018 @11:01AM (#18426990)
After a few years at a registrar, my experience is it comes up quite often enough. It's rare that the person is concerned enough to change to a DNS provider that allows alias/ANAME records, but people do ask about it.
Re:Should you use www or not in your domain? (2017) by PavlovsCat on Sunday November 11, 2018 @05:08PM (#18428942)
Being able to have cookies restricted to a subdomain is kinda one of my favourite things about subdomains. I just like the idea of requests being minimal, and when you have a lot of static public assets, you can put them on another subdomain without cookies. That no longer works if you have a lot of cookies on the origin, since those get sent always.
Re:Should you use www or not in your domain? (2017) by sureaboutthis on Sunday November 11, 2018 @11:38PM (#18430619)
What difference does it make if is written "www" or not? "www" is a subdomain like any other and works exactly the same.
Re:Should you use www or not in your domain? (2017) by hacknat on Sunday November 11, 2018 @10:36AM (#18426831)
CNAMEs can’t point to an IP, not sure what you even mean by that.
Re:Should you use www or not in your domain? (2017) by tyingq on Sunday November 11, 2018 @10:49AM (#18426922)
Netlify explains the issue in pretty good detail. https://www.netlify.com/blog/2017/02/28/to-www-or-not-www/
Re:Should you use www or not in your domain? (2017) by hacknat on Sunday November 11, 2018 @10:53AM (#18426944)
What do you mean explains it? CNAMEs can’t point to IPs. This article doesn’t say otherwise. Also this article says you should use “www”.
Re:Should you use www or not in your domain? (2017) by tyingq on Sunday November 11, 2018 @10:55AM (#18426957)
The post you replied to also said a CNAME can't point to an IP:

"as far as a CNAME needing to point to another domain instead of an IP"

So, it's unclear to me who you're arguing with. I thought a post explaining why using a CNAME on an "apex domain" is potentially problematic might be helpful. Guess not.

Re:Should you use www or not in your domain? (2017) by gpvos on Sunday November 11, 2018 @12:25PM (#18427425)
To me, that sentence reads as that it's possible for a CNAME to point to an IP, but that someone has a need to point it to a domain. Which makes the sentence incorrect, since it assumes something impossible, and explains hacknat's urge to correct it.