add resolved IP address in "Details" tab
diff --git a/mitmproxy/console/flowdetailview.py b/mitmproxy/console/flowdetailview.py
index 757c76fdab..8e3a47ae84 100644
--- a/mitmproxy/console/flowdetailview.py
+++ b/mitmproxy/console/flowdetailview.py
@@ -23,6 +23,7 @@ def flowdetails(state, flow):
         text.append(urwid.Text([("head", "Server Connection:")]))
         parts = [
             ["Address", repr(sc.address)],
+            ["Peer Address", repr(sc.peer_address)],
         ]
 
         text.extend(
diff --git a/mitmproxy/flow_format_compat.py b/mitmproxy/flow_format_compat.py
index a7a95af3ab..4c3aa7270d 100644
--- a/mitmproxy/flow_format_compat.py
+++ b/mitmproxy/flow_format_compat.py
@@ -35,6 +35,7 @@ def convert_015_016(data):
 
 
 def convert_016_017(data):
+    data["server_conn"]["peer_address"] = None
     data["version"] = (0, 17)
     return data
 
diff --git a/mitmproxy/models/connections.py b/mitmproxy/models/connections.py
index 857580b8ec..2ffc667d2a 100644
--- a/mitmproxy/models/connections.py
+++ b/mitmproxy/models/connections.py
@@ -120,6 +120,7 @@ def tls_established(self):
         timestamp_tcp_setup=float,
         timestamp_ssl_setup=float,
         address=tcp.Address,
+        peer_address=tcp.Address,
         source_address=tcp.Address,
         cert=certutils.SSLCert,
         ssl_established=bool,
diff --git a/netlib/tcp.py b/netlib/tcp.py
index 6423888a14..574f384582 100644
--- a/netlib/tcp.py
+++ b/netlib/tcp.py
@@ -458,9 +458,11 @@ def _makefile(self):
     def __init__(self, connection):
         if connection:
             self.connection = connection
+            self.peer_address = Address(connection.getpeername())
             self._makefile()
         else:
             self.connection = None
+            self.peer_address = None
             self.rfile = None
             self.wfile = None
 
@@ -701,6 +703,7 @@ def connect(self):
                 'Error connecting to "%s": %s' %
                 (self.address.host, err))
         self.connection = connection
+        self.peer_address = Address(connection.getpeername())
         self._makefile()
 
     def settimeout(self, n):
diff --git a/test/mitmproxy/tutils.py b/test/mitmproxy/tutils.py
index edcdf3e212..0d65df7172 100644
--- a/test/mitmproxy/tutils.py
+++ b/test/mitmproxy/tutils.py
@@ -93,6 +93,7 @@ def tserver_conn():
     c = ServerConnection.from_state(dict(
         address=dict(address=("address", 22), use_ipv6=True),
         source_address=dict(address=("address", 22), use_ipv6=True),
+        peer_address=None,
         cert=None,
         timestamp_start=1,
         timestamp_tcp_setup=2,

It's useful to know the peer address when the domain has several IP addresses and you need to know where the request has gone.
