12

I'm using a "synthetic record" at Google Domains to redirect traffic from the bare domain example.com to www.example.com:

enter image description here

This works for requests to http://example.com, of which there are 4 A records that all point to Google Apps IP addresses (makes sense, that's how they handle "synthetic records" for a host name that you haven't mapped to an A record). The response to such requests is:

HTTP/1.1 302 Found
Location: http://www.example.com
Date: Wed, 30 Sep 2015 17:08:59 GMT
Content-Type: text/html; charset=UTF-8
Server: ghs
Content-Length: 230
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN

However, requests to https://example.com are completely ignored. There is no response from the server. Has anyone else run into this limitation with Google's implementation of redirecting a bare domain to a subdomain? Any advice for getting around this without having my own A record at the apex?

8

Google has very recently added an option to support redirect over SSL. Not sure how this is being done but it appears that Google is setting up their own SSL cert to make this possible. Enabling this feature shows a message "This synthetic record has an error and will not function correctly: The SSL Certificate for this domain hasn't been created yet. This process may take up to 24 hours to complete."

Setup and tested this and it works well.

screenshot

  • Is that a new feature? I don't see that option on my dashboard – carlolm May 19 '18 at 1:01
  • I also don't see this feature yet, is it not available to everyone or do I need to opt in to a beta or something? – steve May 25 '18 at 18:25
  • Strangely enough, this option is available on my business account but not on my personal account. I do not have an SSL cert setup on any of my personal websites so I wonder if this is enabled by adding an SSL cert and enabled HTTPS. For folks not seeing this option, do you have an SSL cert in place on your site? – Russell Jun 18 '18 at 14:20
  • This is a subdomain forward. How does that forward a bare domain, like the one in the question? – dfrankow Mar 23 at 19:27
  • I may have answered my own question. I think you can put a "@" in the subdomain box. – dfrankow Mar 23 at 19:38
3

However Google is handling this redirection service, you can't configure anything more than one subdomain to another (or bare, vice versa). This means no redirection code (301 vs 302), no installing an SSL certificate to respond over HTTPS, etc.

I'm hosting more sites at places like Heroku these days, where we don't get a static IP address and need to add a CNAME record for a subdomain. DNS doesn't typically support adding a CNAME to the bare domain, which is a good thing since it could conflict with other records on the bare domain like MX.

Cloudflare has been my preferred approach to this. Free DNS management (including redirects) and DoS mitigation along with SSL that supports modern browsers. For a broader range of browser coverage, add-on a dedicated SSL for $5/mo and you've got a great package all around.

0

It's a separate option to redirect the main domain as opposed to a subdomain. Just click on the "Add a Website" icon. First icon on the right of the domain. You will see a pop-up with an option to forward the domain.

  • This is the same as subdomain forwarding with an @ for the root domain. Doesn't support HTTPS. Not helpful. – Gabe Rogan Nov 3 '17 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.