Skip to content

Instantly share code, notes, and snippets.

@jaydenseric
Created March 20, 2017 04:46
Show Gist options
  • Star 86 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save jaydenseric/cf7e548d3ce035da05fae5782878b80f to your computer and use it in GitHub Desktop.
Save jaydenseric/cf7e548d3ce035da05fae5782878b80f to your computer and use it in GitHub Desktop.
Zeit Now G Suite setup

Run each of the following lines, replacing yourdomain.com and codehere with your details:

now dns add yourdomain.com @ TXT google-site-verification=codehere
now dns add yourdomain.com @ MX ASPMX.L.GOOGLE.COM 1
now dns add yourdomain.com @ MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT3.ASPMX.L.GOOGLE.COM 10
now dns add yourdomain.com @ MX ALT4.ASPMX.L.GOOGLE.COM 10

Docs:

@abmirayo
Copy link

thanks!

Copy link

ghost commented May 29, 2018

Much appreciated - thanks!

@WesSouza
Copy link

I'm lazy so I forked a version with variables lol

https://gist.github.com/WesleydeSouza/d49838ee8bf7bbce9487db34366c312a

@vrease
Copy link

vrease commented Jan 22, 2019

Thanks!

@ajhool
Copy link

ajhool commented Mar 29, 2019

Has anybody had issues with this? For some reason, google is not recognizing my setup. My domain registrar is AWS and I also tried adding the certificates there, but no luck. I don't even know where to begin debugging

@twelvearrays
Copy link

Thanks!

@aleks-rdea
Copy link

Legend. Thanks for this!

@wallawe
Copy link

wallawe commented Aug 22, 2019

<3 thanks

@rlindskog
Copy link

For anyone seeing this today, I had to do now dns add yourdomain.com @ MX codehere 15 instead of the first TXT record.

@rvargs
Copy link

rvargs commented Oct 13, 2019

For anyone seeing this today, I had to do now dns add yourdomain.com @ MX codehere 15 instead of the first TXT record.

Thank you @rlindskog !

@crnelious
Copy link

crnelious commented Oct 15, 2019

For anyone seeing this today, I had to do now dns add yourdomain.com @ MX codehere 15 instead of the first TXT record.

@rlindskog doesn't seem to work for me, keep getting "Invalid value parameter (not a valid FQDN) (400)" - is there another way?

@paulogdm
Copy link

To avoid problems with terminals and reserved words, I recommend:

now dns add yourdomain.com '@' TXT google-site-verification=codehere
now dns add yourdomain.com '@' MX ASPMX.L.GOOGLE.COM 1
now dns add yourdomain.com '@' MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com '@' MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com '@' MX ALT3.ASPMX.L.GOOGLE.COM 10
now dns add yourdomain.com '@' MX ALT4.ASPMX.L.GOOGLE.COM 10

@billyfung
Copy link

above worked great, thanks

@waliurjs
Copy link

waliurjs commented Jan 5, 2020

I was getting:

Error! Invalid value parameter (not a valid FQDN) (400)

Following worked for me: (Jan, 2020)
now dns add yourdomain.com @ MX XXXXSECRETXXXXX.MX-VERIFICATION.GOOGLE.COM 15

@subtleGradient
Copy link

Yay! Thanks!

@gil-air-may
Copy link

Working (Jan 2020). Thanks

@granmoe
Copy link

granmoe commented Jan 15, 2020

@oleole90

I was getting:

Error! Invalid value parameter (not a valid FQDN) (400)

Following worked for me: (Jan, 2020)
now dns add yourdomain.com @ MX XXXXSECRETXXXXX.MX-VERIFICATION.GOOGLE.COM 15

Same, and your solution worked for me, too. Thanks :-)

@wunnle
Copy link

wunnle commented Jan 24, 2020

Thanks a bunch!

@rob-balfre
Copy link

Thanks! 🤘

@samstr
Copy link

samstr commented Apr 14, 2020

Following on from @oleole90's solution:

I had the same issue using the mx verification record provided by G Suite. (For some reason they want an MX record nowadays rather than a TXT)

> now dns add yourdomain.com @ MX xxxsecretxxx.mx-verification.google.com. 15
> Now CLI 18.0.0
> Error! Invalid `value` parameter (not a valid FQDN) (400)

Turns out it was the full-stop at the end of the hostname causing the error. Remove the dot and we're good.

> now dns add yourdomain.com @ MX xxxsecretxxx.mx-verification.google.com 15
> Now CLI 18.0.0
> Success! DNS record for domain yourdomain.com (rec_xxx) created under username

@raringsunny
Copy link

raringsunny commented Apr 25, 2020

Hi guys,

I am new to Zeit and I have hosted a website on zeit platform recently.

I have a GSuite subscription primarily for the Gmail server using my custom domain. I have originally registered my domain with Namesilo. What I have been told by Namesilo is that now I need to move all my A, CNAME, MX and TXT records with to zeit as I am using Zeit's nameservers.

I have already done that - created CNAME, MX and TXT records on Zeit platform. What I want is to be able to redirect a user to google mail for my custom domain. My mail is perfectly setup on Google.

When I browse to mail..com, it doesn't work. Couple of questions.

  1. Do I need to setup a subdomain on Zeit? mail..com??
  2. What CNAME record I need to create?

Attached image lists all record types.

Any help is appreciated.

Thanks,
Sunny

Zeit records

I get the following error:
error mail

@raringsunny
Copy link

And now getting this error.

error mail 2

@raringsunny
Copy link

It is so strange that now I am able to access this website from my mobile safari browser but not through chrome on windows.

@djstein
Copy link

djstein commented Apr 28, 2020

newest version of this is:

now dns add domain.com '@' MX ASPMX.L.GOOGLE.COM 1
now dns add domain.com '@' MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add domain.com '@' MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add domain.com '@' MX ALT3.ASPMX.L.GOOGLE.COM 10
now dns add domain.com '@' MX ALT4.ASPMX.L.GOOGLE.COM 10
now dns add domain.com '@' MX <CODE>.mx-verification.google.com 15

@shivaylamba
Copy link

@djstein I am still getting error Invalid value parameter (not a valid FQDN) (400)

@richyrb00
Copy link

@djstein thank you. i didn't need to add the last one though.

https://support.google.com/a/answer/174125?hl=en
these are the MX records i've added.

@zeroproduct
Copy link

@djstein Thank you, this worked for me as well.

I also didn't add the last command and it still worked. Does anyone know if it is required?

@paulogdm
Copy link

Hello everyone,

We are beta testing our DNS UI! You can activate it on vercel.com/_flags. Check your domain's dashboard after that.

@miken91
Copy link

miken91 commented May 30, 2020

@richyrb00 these records seem to work great. Super easy with the DNS ui @paulogdm.

@djstein
Copy link

djstein commented Jun 22, 2020

thanks @paulogdm!

and for everyone else, I added the MX record for my specific Google Business email access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment