Created: 2008-09-05 15:18
Updated: 2017-01-01 20:09


Slicehost DNS Script

I found the SliceManager to be a little time consuming when creating multiple DNS records for multiple domains. This ruby script interfaces with Slicehost's API to add the basic DNS records for a domain.

If you need DNS entries other than (or instead of) those that come with the script (see below), it should be fairly easy to open the script and modify the records to your liking.


  • There's just a single file (slicedns.rb). Get it.
  • Get an API key from your SliceManager at:
  • Open the script and replace "your_api_key_goes_here" with your API key.
  • Save the script.
  • Make sure the script is executable by you: chmod 744 slicedns.rb
  • Run the script (see 'Usage' below).


./slicedns.rb slice_name

There are two required arguments for the script. The first is the name of your slice. The second is the domain name (with trailing period [.]).

The script will create a zone with the DNS records shown below. It will ask you if you want to also create the Google Apps records.

If the zone already exists, you will be prompted to Cancel or Overwrite the existing records. Choosing overwrite will delete the whole zone (including any custom records you have previously set up) and start from scratch.

DNS Records Created

The following records will be created in the zone:                    A       [your slice's IP]
*                  A       [your slice's IP]
                                   NS                    NS                    NS

If you respond with Y to "Add records for Google Apps? [Yn]" the following will also be created:                    MX      10 ASPMX.L.GOOGLE.COM.                    MX      20 ALT1.ASPMX.L.GOOGLE.COM.                    MX      20 ALT2.ASPMX.L.GOOGLE.COM.                    MX      30 ASPMX2.GOOGLEMAIL.COM.                    MX      30 ASPMX3.GOOGLEMAIL.COM.                    MX      30 ASPMX4.GOOGLEMAIL.COM.                    MX      30 ASPMX5.GOOGLEMAIL.COM.
mail                            CNAME
start                           CNAME
docs                            CNAME
calendar                        CNAME  SRV      5 0 5269  SRV     20 0 5269  SRV     20 0 5269  SRV     20 0 5269  SRV     20 0 5269       SRV      5 0 5269       SRV     20 0 5269       SRV     20 0 5269       SRV     20 0 5269       SRV     20 0 5269
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more