Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java	(revision 7799)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java	(revision 7800)
@@ -1,4 +1,7 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.io.remotecontrol;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
 
 import org.openstreetmap.josm.Main;
@@ -34,4 +37,6 @@
     static final int protocolMajorVersion = 1;
     static final int protocolMinorVersion = 7;
+
+    private static final String LOCALHOST = "localhost";
 
     /**
@@ -71,3 +76,23 @@
         return Main.pref.getPreferencesDir() + "remotecontrol/";
     }
+
+    /**
+     * Returns the inet address used for remote control.
+     * @return the inet address used for remote control
+     * @throws UnknownHostException if the local host name could not be resolved into an address.
+     * @since 7800
+     */
+    public static InetAddress getInetAddress() throws UnknownHostException {
+        String hostname = Main.pref.get("remote.control.host", LOCALHOST);
+        InetAddress result = InetAddress.getByName(hostname);
+        // Sometimes localhost resolution does not work as expected, see #10833
+        if (LOCALHOST.equalsIgnoreCase(hostname) && !LOCALHOST.equalsIgnoreCase(result.getHostName())) {
+            InetAddress localhostAddr = InetAddress.getLocalHost();
+            // Use this result if it's better. Not sure if it's a Java bug or not
+            if (LOCALHOST.equalsIgnoreCase(localhostAddr.getHostName())) {
+                result = localhostAddr;
+            }
+        }
+        return result;
+    }
 }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 7799)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 7800)
@@ -6,5 +6,4 @@
 import java.io.IOException;
 import java.net.BindException;
-import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
@@ -68,9 +67,7 @@
         this.setDaemon(true);
         // Start the server socket with only 1 connection.
-        // Also make sure we only listen
-        // on the local interface so nobody from the outside can connect!
+        // Also make sure we only listen on the local interface so nobody from the outside can connect!
         // NOTE: On a dual stack machine with old Windows OS this may not listen on both interfaces!
-        this.server = new ServerSocket(port, 1,
-            InetAddress.getByName(Main.pref.get("remote.control.host", "localhost")));
+        this.server = new ServerSocket(port, 1, RemoteControl.getInetAddress());
     }
 
@@ -80,6 +77,6 @@
     @Override
     public void run() {
-        Main.info(marktr("RemoteControl::Accepting connections on port {0}"),
-             Integer.toString(server.getLocalPort()));
+        Main.info(marktr("RemoteControl::Accepting connections on {0}:{1}"),
+                server.getInetAddress(), Integer.toString(server.getLocalPort()));
         while (true) {
             try {
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java	(revision 7799)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java	(revision 7800)
@@ -9,5 +9,4 @@
 import java.math.BigInteger;
 import java.net.BindException;
-import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
@@ -380,9 +379,7 @@
 
         // Start the server socket with only 1 connection.
-        // Also make sure we only listen
-        // on the local interface so nobody from the outside can connect!
+        // Also make sure we only listen on the local interface so nobody from the outside can connect!
         // NOTE: On a dual stack machine with old Windows OS this may not listen on both interfaces!
-        this.server = factory.createServerSocket(port, 1,
-            InetAddress.getByName(Main.pref.get("remote.control.host", "localhost")));
+        this.server = factory.createServerSocket(port, 1, RemoteControl.getInetAddress());
 
         if (Main.isTraceEnabled() && server instanceof SSLServerSocket) {
@@ -402,6 +399,6 @@
     @Override
     public void run() {
-        Main.info(marktr("RemoteControl::Accepting secure connections on port {0}"),
-             Integer.toString(server.getLocalPort()));
+        Main.info(marktr("RemoteControl::Accepting secure connections on {0}:{1}"),
+                server.getInetAddress(), Integer.toString(server.getLocalPort()));
         while (true) {
             try {
