diff --git a/varnish.admin.inc b/varnish.admin.inc
index 869af76..e29dca5 100644
--- a/varnish.admin.inc
+++ b/varnish.admin.inc
@@ -12,6 +12,10 @@
 function varnish_admin_settings_form() {
   $form = array();
 
+  global $base_url;
+  $parts = parse_url($base_url);
+  $host_string = $parts['host'];
+
   if (!extension_loaded('sockets')) {
     drupal_set_message(t('<a href="http://php.net/manual/en/sockets.installation.php">PHP Sockets extension</a> not enabled. Varnish terminal communication configuration skipped.'), 'error');
     return system_settings_form($form);
@@ -52,6 +56,13 @@ function varnish_admin_settings_form() {
     '#default_value' => variable_get('varnish_control_key', ''),
     '#description' => t('Optional: if you have established a secret key for control terminal access, please put it here.'),
   );
+  $form['varnish_host_string'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Varnish Host String'),
+    '#default_value' => variable_get('varnish_host_string', $host_string),
+    '#description' => t('Optional: if you need a host string that is other than parsed from $base_url as set in settings.php.'),
+    );
+
   $form['varnish_socket_timeout'] = array(
    '#type' => 'textfield',
    '#title' => t('Varnish connection timeout (milliseconds)'),
diff --git a/varnish.module b/varnish.module
index 59032f0..fb8ba8f 100644
--- a/varnish.module
+++ b/varnish.module
@@ -171,7 +171,7 @@ function theme_varnish_status($status) {
 function _varnish_get_host() {
   global $base_url;
   $parts = parse_url($base_url);
-  return $parts['host'];
+  return variable_get('varnish_host_string', $parts['host']);
 }
 
 
