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"