Hacker News new | ask | show | jobs
by n2d4 1001 days ago
You can't redirect sites like that with DNS. All of those domains resolve to the IP of a load balancer (probably the same one minus some anycast routing), which then decides whether to show the requested service based on the HTTP Host header, not the DNS record. You can quickly verify this by looking up mail.google.com via DNS and putting that IP into your browser bar, which will redirect to google.com instead of opening Gmail.

A CNAME record would just mean they use the same load balancer.

    $ curl -H "Host: mail.google.com" 142.251.16.17
    ...gmail-specific html

    $ curl -H "Host: maps.google.com" 142.251.16.17
    ...gmaps-specific html

    $ curl -H "Host: www.google.com" 142.251.16.17
    ...google search-specific html
1 comments

Thanks, that is really insightful! :)