diff --git a/modules/hosting/signup/hosting_signup.backend.inc b/modules/hosting/signup/hosting_signup.backend.inc
index e91cf06..ed8c8bc 100644
--- a/modules/hosting/signup/hosting_signup.backend.inc
+++ b/modules/hosting/signup/hosting_signup.backend.inc
@@ -63,6 +63,12 @@ function hosting_signup_get_form($server_key, &$form_state, $post = array()) {
 function _hosting_signup_form() {
   $node = new stdClass();
   $form['site'] = hosting_site_form($node);
+
+  if (variable_get('hosting_signup_friendly_domain_field', FALSE)) {
+    $form['site']['title']['#type'] = 'domain_or_subdomain';
+    $form['site']['title']['#alias_subdomain'] = variable_get('hosting_alias_subdomain', 'dev');
+  }
+
   unset($form['site']['client']);
   $form['site']['platform'] = array(
     '#type' => 'hidden',
@@ -148,6 +154,9 @@ function _hosting_signup_form_validate($form, &$form_state) {
 
   $site = (object) $form_state['values'];
   $site->type = 'site';
+  if (!$form_state['values']['own_domain'] && $form_state['values']['subdomain']) {
+    $site->title .= '.' . $form_state['values']['subdomain'];
+  }
   node_validate($site);
   hosting_signup_singleton(form_get_errors());
 } 
@@ -167,6 +176,9 @@ function _hosting_signup_form_submit($form, &$form_state) {
 
   $site = (object) $form_state['values'];
   $site->type = 'site';
+  if (!$form_state['values']['own_domain'] && $form_state['values']['subdomain']) {
+    $site->title .= '.' . $form_state['values']['subdomain'];
+  }
   $site->status = 1;
   $site->client = $client->nid;
   node_save($site);
diff --git a/modules/hosting/signup/hosting_signup.module b/modules/hosting/signup/hosting_signup.module
index e285bba..acee5ad 100644
--- a/modules/hosting/signup/hosting_signup.module
+++ b/modules/hosting/signup/hosting_signup.module
@@ -49,6 +49,20 @@ function hosting_signup_menu() {
 }
 
 /**
+ * Implementation of hook_theme().
+ */
+function hosting_signup_theme() {
+  return array(
+    'domain_or_subdomain' => array(
+      'arguments' => array('element' => NULL),
+    ),
+    'hosting_signup_domain' => array(
+      'arguments' => array('element' => NULL),
+    ),
+  );
+}
+
+/**
  * Implementation of hook_perm
  */
 function hosting_signup_perm() {
@@ -71,9 +85,84 @@ function hosting_signup_settings() {
     '#description' => t('A unique identifier used when communicating with the server'),
     '#default_value' => variable_get('hosting_signup_server_key', ''),
   );
+  $form['hosting_signup_friendly_domain_field'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Use friendly domain field'),
+    '#default_value' => variable_get('hosting_signup_friendly_domain_field', FALSE)
+  );
   return system_settings_form($form);
 }
 
+/**
+ * Implementation of hook_elements().
+ */
+function hosting_signup_elements() {
+  return array(
+    'domain_or_subdomain' => array(
+      '#input' => TRUE,
+      '#process' => array('hosting_domain_or_subdomain_process'),
+      '#own_domain_default' => TRUE,
+      '#size' => 35,
+      '#maxlength' => 250,
+    ),
+  );
+}
+
+/**
+ * Processor for the domain_or_subdomain form element.
+ */
+function hosting_domain_or_subdomain_process($element, $edit, $form_state, $form) {
+  $element[$element['#name']] = array(
+    '#type' => 'hosting_signup_domain',
+    '#size' => $element['#size'],
+    '#maxlength' => $element['#maxlength'],
+    '#default_value' => $element['#default_value'],
+    '#id' => $element['#id'],
+    '#name' => $element['#name'],
+  );
+
+  if (hosting_feature('alias') && $element['#alias_subdomain'] && variable_get('hosting_alias_subdomain', FALSE)) {
+    $element[$element['#name']]['#domain'] = $element['#alias_subdomain'];
+    $element['own_domain'] = array(
+      '#type' => 'checkbox', 
+      '#title' => t('I have my own domain name.'),
+      '#default_value' => $element['#own_domain_default'],
+    );
+    $element['subdomain'] = array(
+      '#type' => 'value',
+      '#value' => $element['#alias_subdomain'],
+    );
+  }
+  else {
+    $element['own_domain'] = array(
+      '#type' => 'value',
+      '#value' => TRUE,
+    );
+  }
+  return $element;
+}
+
+/**
+ * Theme function for a domain_or_subdomain element.
+ */
+function theme_domain_or_subdomain($element) {
+  drupal_add_js(drupal_get_path('module', 'hosting_signup') . '/hosting_signup_subdomains.js');
+  return theme('form_element', $element, $element['#children']);
+}
+
+/**
+ * Theme function for a domain element
+ */
+function theme_hosting_signup_domain($element) {
+  $output = '<input type="text" class="" maxlength="'. $element['#maxlength'] .'" name="'. $element['#name'] .'" id="'. $element['#id'] .'" size="'. $element['#size'] .'" value="'. check_plain($element['#value']) .'"'. drupal_attributes($element['#attributes']) .' />';
+
+  if (!empty($element['#domain'])) {
+    $output .= '<span class="subdomain-domain" style="display: none">.' . $element['#domain'] . '</span>';
+  }
+  $output = 'http://' . $output . '/';
+
+  return theme('form_element', $element, $output);
+}
 
 /**
  * Small helper function to provide a clean default URL
