Skip to content

Instantly share code, notes, and snippets.

@vitalie
Created August 27, 2012 13:04
Show Gist options
  • Save vitalie/3488255 to your computer and use it in GitHub Desktop.
Save vitalie/3488255 to your computer and use it in GitHub Desktop.
LuaDNS - Heroku Configuration Example (Lua)
-- File: example.com.lua
-- Variable _a is replaced with zone name
-- _a = example.com
-- replace heroku-app-name with application name
heroku_app(_a, "heroku-app-name.herokuapp.com")
function heroku_app(domain, app_name)
-- Create CNAME for www
cname(concat("www", domain), app_name)
-- Usage of A records for naked domains is highly discouraged
-- here we are using A records only for redirection
-- mydomain.com will be redirected to www.mydomain.com
-- using "rack-canonical-host" or other method
a(domain, "75.101.163.44")
a(domain, "75.101.145.87")
a(domain, "174.129.212.2")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment