Skip to content

Instantly share code, notes, and snippets.

@vitalie
Created August 27, 2012 11:49
Show Gist options
  • Save vitalie/3487809 to your computer and use it in GitHub Desktop.
Save vitalie/3487809 to your computer and use it in GitHub Desktop.
LuaDNS - Google Apps Configuration Example (Lua)
-- File: example.com.lua
-- Variable _a is replaced with zone name
-- _a = example.com
--- ...
-- Call template with domain name as parameter
google_apps(_a)
-- ...
function google_apps(domain)
-- Set record for mail.domain.com
-- it will allow us to access the mail using http://mail.domain.com
-- instead of http://www.google.com/a/domain.com
cname(concat("mail", domain), "ghs.google.com")
-- Records required to host mail on Google Apps platform
mx(domain, "aspmx.l.google.com", 1)
mx(domain, "alt1.aspmx.l.google.com", 5)
mx(domain, "alt2.aspmx.l.google.com", 5)
mx(domain, "aspmx2.googlemail.com", 10)
mx(domain, "aspmx3.googlemail.com", 10)
-- SPF record
-- include Google's SPF configuration
txt(domain, "v=spf1 a mx include:_spf.google.com ~all")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment