 
   createDomain = (options, callback)->
 
-    {domainData, account, group, stack} = options
-
-    domainData.proposedDomain = domainData.domain
-    delete domainData.domain
+    { domain, account, group, stack, hostnameAlias } = options
+
+    domainData = { proposedDomain: domain, group }
 
     JStack = require './stack'
     JStack.getStack account, stack, (err, stack)=>


    domains.forEach (domain) ->

      createDomain {
        domainData: {
          domain, hostnameAlias : [ hostnameAlias ]
        }, account, group, stack
      }, (err, domain)->

        if err? then console.error err  unless err.code is 11000

    return {type: 'internal', slug, prefix, domain}


  resolveDomain = (domain, callback, check)->

    return callback null  unless check

    dns = require 'dns'
    dns.resolve domain, (err, remoteIps)->
