Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Jan 28, 2012 8:52 pm 
Offline
Junior Member

Joined: Thu Nov 25, 2010 7:41 pm
Posts: 27
Title is pretty self-explanitory really, I'm sure most(?) people use Google Apps for email hosting, and a button on the DNS manager to just import those 'default' Google MX records would be wonderful, as they are a hassle to add when setting up a new domain.


Top
   
 Post subject:
PostPosted: Wed Feb 01, 2012 11:49 am 
Offline
Junior Member

Joined: Tue Aug 31, 2010 12:14 am
Posts: 27
This is a good idea.
It would be cool if Linode had templates for different things, such as google apps
Select from a list of templates and import the settings into your DNS config

Something similar to what most routers have for port forwarding, you can simply select FTP, SSH, mail, etc
Obviously not for ports though, but it's the same idea


Top
   
 Post subject:
PostPosted: Wed Feb 01, 2012 7:08 pm 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
The problem with this is it could be construed as an endorsement of google apps by linode.

ie, if they did this, they're opening a can of worms for people to want the same for any other service.


Top
   
 Post subject:
PostPosted: Mon Feb 06, 2012 12:22 am 
Offline
Senior Newbie

Joined: Thu Sep 29, 2011 3:07 pm
Posts: 11
I can't imagine it would be too hard for them to have certain DNS records available for pre-population if desired. Making our lives easier is in no way an "endorsement".

I mean, not that I want to compare Linode to DreamHost, but coming from them not too long ago, I know they have a simple option for setting mail to "Google Apps". All it does is pre-populate the MX records for you, and I think adds some default CNAME records as well to help beginners out. They're not endorsing Google Apps, heck, right next to that option is the option for letting DH handle your email. They just realize that a LOT of people like using Google Apps, and have no problem making life easier for the people who do use Google Apps.

If a lot of people wanted another service's DNS records available for pre-population, Linode could just add it to the list and it'd be that simple. But I think the overwhelming argument for the GApps records is because so many people here use them. Time and time again, I hear some of the "pros" here (or at least people who seem to know a heck of a lot about these systems) say that if possible for the situation, go with someone else hosting the mail, specifically Google Apps, because it reduces so many headaches.

TL;DR - I think it's more of an endorsement by the user community than it is by Linode for having those records available for pre-population.


Top
   
 Post subject:
PostPosted: Mon Feb 06, 2012 12:47 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Hmm, maybe we could have something like StackScripts for DNS records? That way, users can contribute whatever they need, and there will be no questions about official endorsement of this or that.

For example, an ideal "template" for Google Apps might contain not only MX records but also an appropriate SPF record (include:_spf.google.com) and maybe even DKIM (copy from your GApps control panel and paste into a textbox).

Similarly, we could have templates for other e-mail hosting services (Microsoft, Rackspace, etc), CDNs (CloudFlare, etc), and whatever else usually involves a lot of Ctrl+C Ctrl+V.


Top
   
 Post subject:
PostPosted: Mon Feb 06, 2012 12:53 am 
Offline
Senior Newbie

Joined: Thu Sep 29, 2011 3:07 pm
Posts: 11
Hadn't even thought of a "user-submitted" style like StackScripts! That definitely removes the notion of Linode endorsing anything as well.

Thanks hybinet, for drawing the parallel between what I was getting at and what already exists (and works well)! :)


Top
   
 Post subject:
PostPosted: Mon Feb 06, 2012 1:27 am 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
Here's a start. SPF added from hybinet's post.

First off, get your API Key. Log in to Linode Manager, click on My Profile (top right) and get your key from that page. You'll use that in every command

Run this to get your DNS domain ID. The return is in JSON format, which isn't the easiest thing to read as a human, but it's doable. The return should have an empty ERRORARRAY followed by a DATA section with each domain in curly braces, comma separated. Find the right domain and use its ID for the rest
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.list

If you're not sure if there is an MX record, you can run this one. Return will be similar to the first one, but this time, each resource in curly braces, comma separated
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.resource.list\&domainID="<domain ID>"

If you have an MX and want to delete with API (it's probably easier to skip the last step and this one and just check in the manager and delete by hand), put the resource ID of the MX from the previous into this one:
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.resource.delete\&domainID="<domain ID>"\&resourceID="<resource ID>"

Tun this bunch to add the 5 recommended MX servers (this is the current list as of Feb 2012, if you're finding this thread 5 years from now, you'll probably want to validate this list...). Return should be empty ERRORARRAY and DATA containing the new Resource ID. You should immediately be able to see the new record(s) in linode manager, but remember that the push from manager to DNS is every 15 mins, plus any TTL if you had existing MX records. So, don't be surprised if it takes a day for google to see your MX records.
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.resource.create\&domainID="<domain ID>"\&type="MX"\&target="ASPMX.L.GOOGLE.COM"\&priority="1"
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.resource.create\&domainID="<domain ID>"\&type="MX"\&target="ALT1.ASPMX.L.GOOGLE.COM"\&priority="5"
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.resource.create\&domainID="<domain ID>"\&type="MX"\&target="ALT2.ASPMX.L.GOOGLE.COM"\&priority="5"
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.resource.create\&domainID="<domain ID>"\&type="MX"\&target="ASPMX2.GOOGLEMAIL.COM"\&priority="10"
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.resource.create\&domainID="<domain ID>"\&type="MX"\&target="ASPMX3.GOOGLEMAIL.COM"\&priority="10"

If you want a cname that'll bounce to gmail, then run this one, editing the hostname to whatever you want. Same as last one, return should be empty ERRORARRY and DATA with the new resource ID.
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.resource.create\&domainID="<domain ID>"\&type="CNAME"\&name="<your gmail subdomain, eg mail.yourdomain.com>"\&target="GHS.GOOGLEMAIL.COM"

SPF record. Same returns as previous two.
wget -qO- https://api.linode.com/?api_key="<your api key>"\&api_action=domain.resource.create\&domainID="<domain ID>"\&type="TXT"\&target="v=spf1 a mx include:_spf.google.com ~all"


Last edited by glg on Mon Feb 06, 2012 1:54 am, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Mon Feb 06, 2012 1:43 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
glg wrote:
(code)

SPF could be added as type="TXT"&target="v=spf1 a mx include:_spf.google.com ~all"

With a little polishing, that could be made into an actual StackScript. Prompt the user for the API key and the domain, ask [y/n] to delete existing MX records, and automate the rest. No need to prompt for domain and resource IDs, since you can get the full list with another API call and look up the ID.

But of course, it would be so much easier to just click something in the DNS manager than to mess with #!/bin/bash.


Top
   
 Post subject:
PostPosted: Mon Feb 06, 2012 7:01 pm 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 567
Website: http://www.mattnordhoff.com/
Linode seems to consider a Google Apps library article appropriate, so also putting something in the DNS manager wouldn't be a stretch.

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Wed Feb 08, 2012 9:56 pm 
Offline
Newbie

Joined: Thu Feb 02, 2012 10:20 am
Posts: 3
Website: http://www.czlayer.com
Location: Beijing/Toronto/Seattle
Agree; I use DNS Made Easy for my DNS hosting and there are templates available for Google Apps and other services. I don't quite see how making prepopulated templates would serve as an endorsement of their service. Sounds like a great idea!


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2012 11:20 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Here's an idea for this sort of stuff: API scripts. Kind of like stack scripts, except they run any time (and on a non-specific linode-run machine). People could write scripts to automate complex tasks and run them through the manager, with a UI like stackscripts have.


Top
   
 Post subject:
PostPosted: Fri Feb 10, 2012 11:44 pm 
Offline
Junior Member

Joined: Thu Nov 25, 2010 7:41 pm
Posts: 27
Guspaz wrote:
Here's an idea for this sort of stuff: API scripts. Kind of like stack scripts, except they run any time (and on a non-specific linode-run machine). People could write scripts to automate complex tasks and run them through the manager, with a UI like stackscripts have.


That's a great idea.


Top
   
 Post subject:
PostPosted: Sun Feb 12, 2012 1:59 am 
Offline
Junior Member

Joined: Mon Apr 11, 2011 9:49 pm
Posts: 49
I've found it much easier to clone a already existing template for my sites. Then all I do is change the TXT SPF/DKIM/Verification strings as necessary.

I thought about setting up my own mail server, but after the random attempts to connect to postfix, I disabled it :P


Top
   
PostPosted: Sun Feb 12, 2012 3:44 am 
Offline
Sysop

Joined: Sat Nov 27, 2010 3:32 am
Posts: 180
Website: https://blog.timheckman.net/
Location: San Francisco, CA
Here you go guys something I (hastily) threw together tonight. The script uses the Linode API to create the records. Should work on any system that has curl installed.

Please note: While this script was written by a Linode employee it is not endorsed nor maintained by Linode. Linode should not be contacted for support using this script or to report any bugs with the script.

- https://github.com/theckman/gapps-linode-dns

Edit: Also allows you to add a default SPF record.


Top
   
PostPosted: Wed Dec 31, 2014 6:51 pm 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
peleus wrote:
I tried to get this to work but couldn't. Has someone else ever set this up and worked for them by any chance?


This thread is nearly 3 years old, so it's quite possible that something changed so it doesn't quite work anymore, but I doubt it. The google apps DNS hasn't changed that I can recall (I don't recall having to change mine). I don't think the linode DNS API has changed either. Did you follow my steps or use the script theckman wrote? What errors do you get?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group