Faster, More Awesome GitHub Pages
github.com
github.com
I wonder why ALIAS took hold but DNAME and ANAME records were never widely supported despite actually making it into a few RFCs. Hrmm.
(Disclaimer: Namecast (http://www.namecast.net) supports ALIAS records as well, so I have an abnormal interest in what was otherwise a small part of the article.)
...which is a bummer, because doing this adds a weird sort of black box step in the DNS resolution chain between client and server. It makes troubleshooting DNS problems not so much fun.
Kudos, this is one of the most subtle advertising comments I've seen yet.
Mine was originally one of the first comments on the article, and it turns out lots of people have had questions about ALIAS records since then, because "what's an ALIAS record?". (If you read the comments, I've actually been advertising for our "competitors" if anything - I think I got DNSMadeEasy a sale today ;).
For example:
If you set up subdomain.yourdomain.com to be an A record to to 10.0.1.1, you can also set up additional A records, AAAA records for IPv6, and even MX and NS records for subdomain.yourdomain.com.
If you set up subdomain.yourdomain.com to be a CNAME, you can't have any other record types for subdomain.yourdomain.com.
ALIAS records exist because you can't CNAME your root record - the root of your domain has to have at the very least an SOA record, and NS records are going to be needed for the domain to actually resolve. Since those record types exist at the root of your domain, and since CNAME's can't coexist with other record types, you can't use CNAME's at the root of your domain.
Accordingly, the ALIAS record really is only useful to redirect the root apex of your domain somewhere else.
(Just my two cents.)
Github stated that if you use an "apex" domain your only option is to set A records to their IP but that doesn't seem right.
It might be that Namecheap allows you to configure "CNAME's" but actually implements them as ALIAS records or HTTP redirects or something similar and obscures that from the user. Not having a Namecheap account I can't say for certain.
GitHub is correct, the @ record cannot be a CNAME.
Normally, this is solved by using a CNAME record, but if you use a CNAME as the zone apex, then you cannot have any subdomains (because they will all be resolved through the CNAME record).
For some additional information: http://scripting.com/stories/2011/11/13/dnsimplesNewAliasFea... http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Cre...
Building on that: The github blog post states that using an ALIAS record will allow you to take advantage of their CDN. I don't know if I believe that. Since the ip is being fetched by the ALIAS supporting nameserver, the CDN will use that as the end user location. Therefore, everyone is going to that location.
The only way around that would be:
1) CDN uses IP ANYCAST (in which case their CDN would work with just listing the IP as well and the ALIAS point is moot)
OR
2) ALIAS supporting nameserver uses the draft edns-client-subnet rfc (very low probability any current ALIAS provider uses it to resolve the ALIAS since support for the draft may be iffy and much heavier ns resolve logic for ALIAS provider).
Additional thoughts welcome.
Update: Github's external CDN provider is using ANYCAST, so that explains why that's working --- AND --- to explain why their CDN doesn't work on direct ip pointing is because they are giving you the ip to their own direct servers, which are non-cdn / non-anycast, which explains why in this case, the ALIAS record gives the benefit for their CDN, while the ip doesn't (because they're having you use a different non-cdn ip so they can change external cdn providers at will and not affect those that are pointing to the ip directly).
a) this is a common problem for CDNs, as you can never guarantee the DNS server that's asking for your CNAME is close to the cache servers that you want to deliver your end-user content; I'd be surprised if the first CDN cache server a client fetches github content from didn't inspect the end-user IP address from the HTTP session and redirect to a closer / "more optimal" point of presence if one were available;
b) In any case, it looks like Fastly is using anycast from a quick telnet to route-views.routeviews.org.
This is the case, and it's a significant problem - especially for people who use Google's DNS server or OpenDNS
There is an experimental, but reasonably widely deployed[1] solution available though.
I'd be surprised if the first CDN cache server a client fetches github content from didn't inspect the end-user IP address from the HTTP session and redirect to a closer / "more optimal" point of presence if one were available;
That's pretty unlikely. The redirect is going to cost more than just serving the data (and of course there is no way to persist that redirect back to the DNS layer, so it will happen for every resource). "Media" CDNs (ie, CDNs optimised for delivery of large files like movies) sometimes work like this though.
HOWEVER, since Fastly/Github is doing Anycast, none of this should affect them.
[1] http://www.cdnplanet.com/blog/which-cdns-support-edns-client...
X-Served-By: cache-fra1225-FRA
X-Served-By: cache-d46-DAL
[1] https://news.ycombinator.com/item?id=6975830The way I read their documentation I set only a CNAME for www -> username.github.io. Does this mean I set no A record at all for the domain, to make sure I get the benefit of the CDN? If yes, how do I ensure requests for example.com resolve to www.example.com?
The easier one to set up is to prefer the www version since it can be done with a simple CNAME and many DNS providers will offer a free automatic 301 forward for the non-www version. (But tastes differ on whether the non-www version looks better.)
Letting both versions resolve would give issues with Google indexing multiple versions of the same page, and reduces the ability to cache properly.
If anyone figures out a better practice please leave a comment. My preference is no www (with www 301-ing) plus the CDN benefit, but this probably isn't possible.
[2] https://github.com/MediaCrush/MediaCrush/blob/master/config/...
And the pages: https://github.com/MediaCrush/mediacrush.github.io
Deployment. It's easy as pie to deploy GitHub pages.
Open-source. MediaCrush itself [1] is open-source, and we wanted the blog to be open and well tuned for pull requests and such.
I might go so far as to say that storing compiled HTML on git is an antipattern, but that isn't to say that you can't mirror the generator and posts on GitHub.
I don't get services like DNSimple. Why would I pay monthly just be able to pay to register domains? What am I missing?
^^This is sort of like saying, "I don't get services like Dropbox. Rsync works fine for me." If you don't think you need an UltraDNS/Dynect/DNSimple type of service, then you probably don't, and there's nothing wrong with that.
(P.S: I'm totally biased, I'm responsible for https://www.namecast.net, a GitHub + DNS mashup).
c:\>ping dangrossman.github.io
Pinging github.map.fastly.net [199.27.72.133]
Fastly (http://www.fastly.com/). ping dangrossman.github.io
round-trip min/avg/max/stddev = 16.173/16.275/16.463/0.074 ms
(From Paris, France)In comparison, Cloudfront is something like 2ms away.
dig +short NS github.io
ns2.p16.dynect.net.
ns4.p16.dynect.net.
ns1.p16.dynect.net.
ns3.p16.dynect.net.https://support.cloudflare.com/hc/en-us/articles/200168706-H...
Last time I tried it wasn't possible.
For example, sheetjs.github.io is configured to handle oss.sheetjs.com: https://github.com/SheetJS/SheetJS.github.io/blob/master/CNA...
The gh-pages branch for js-xls (https://github.com/SheetJS/js-xls/tree/gh-pages), accessible at http://sheetjs.github.io/js-xls, now redirects to http://oss.sheetjs.com/js-xls (and does the right thing so long as the main site repo doesn't have a conflicting directory)
As an example of a conflict, consider http://oss.sheetjs.com/test_files/ . The test_files repo (https://github.com/SheetJS/test_files/tree/gh-pages) is masked by the test_files subdirectory of the main repo (https://github.com/SheetJS/SheetJS.github.io/tree/master/tes...)
Thanks for your insight though, much appreciated.
If your repo github.com/jdan/jdan.github.io has a cleaver subdirectory, then it will direct to the directory in the repo (masking the gh-pages branch). However, if you do not have a cleaver subdirectory (which is the case at the moment of writing), the gh-pages branch will be visible