Index: libs/libmythdb/remotefile.cpp
===================================================================
--- libs/libmythdb/remotefile.cpp	(revision 25218)
+++ libs/libmythdb/remotefile.cpp	(working copy)
@@ -1,3 +1,5 @@
+
+#include <assert.h>
 #include <iostream>
 using namespace std;
 
@@ -52,7 +54,6 @@
 
     QString host = qurl.host();
     int port = qurl.port();
-   
     dir = qurl.path();
 
     if (qurl.hasQuery())
@@ -62,6 +63,7 @@
         dir += "#" + qurl.fragment();
 
     QString sgroup = qurl.userName();
+    QString hostname = GetMythDB()->GetHostName();
 
     MythSocket *lsock = new MythSocket();
     QString stype = (control) ? "control socket" : "file data socket";
@@ -70,13 +72,29 @@
 
     if (port <= 0)
     {
-        port = GetMythDB()->GetSettingOnHost("BackendServerPort", host).toInt();
+        port = GetMythDB()->GetSettingOnHost("BackendServerPort", hostname).toInt();
 
         // if we still have no port use the default
         if (port <= 0)
             port = 6543;
     }
 
+    if (host.isEmpty())
+    {
+        host = GetMythDB()->GetSettingOnHost("BackendServerIP", hostname);
+        if (host.isEmpty())
+        {
+            host = GetMythDB()->GetSetting("BackendServerIP");
+            if (host.isEmpty())
+            {
+                VERBOSE(VB_IMPORTANT,
+                    QString("\n\t\t\tCould not connect to server %1:%2 (Failed to retrieve BackendServerIP!)")
+                    .arg(host).arg(port));
+                return NULL;
+            }
+        }
+    }
+
     if (!lsock->connect(host, port))
     {
         VERBOSE(VB_IMPORTANT, loc_err +
@@ -86,7 +104,6 @@
         return NULL;
     }
     
-    QString hostname = GetMythDB()->GetHostName();
 
     QStringList strlist;
 
