diff --git a/iceprod/core/functions.py b/iceprod/core/functions.py
index 964f20b9..619cc991 100644
--- a/iceprod/core/functions.py
+++ b/iceprod/core/functions.py
@@ -270,16 +270,11 @@ def get_local_ip_address():
 def gethostname():
     """Get hostname of this computer."""
     ret = socket.getfqdn()
-    try:
-        resp = requests.get('http://simprod.icecube.wisc.edu/downloads/getip.php', timeout=1)
-        resp.raise_for_status()
-        logging.info('getip: %r', resp.text)
-        ret2 = resp.text.split(' ')[-1]
-        if len(ret2.split('.')) > 1:
-            ret = '.'.join(ret.split('.')[:1]+ret2.split('.')[1:])
-    except Exception:
-        logging.info('error getting global ip', exc_info=True)
-    return ret
+    ret2 = socket.gethostname()
+    if len(ret2) > len(ret):
+        return ret2
+    else:
+        return ret
 
 
 @contextmanager

diff --git a/tests/core/functions_test.py b/tests/core/functions_test.py
index ffe9f4ac..9ece4946 100644
--- a/tests/core/functions_test.py
+++ b/tests/core/functions_test.py
@@ -672,29 +672,25 @@ class functions_test(AsyncTestCase):
             logging.info('%s',e)
 
     @patch('socket.getfqdn')
-    @requests_mock.mock()
+    @patch('socket.gethostname')
     @unittest_reporter
-    def test_301_gethostname(self, fqdn, http_mock):
+    def test_301_gethostname(self, fqdn, hostname):
         fqdn.return_value = 'myhost'
-        http_mock.get('/downloads/getip.php', text='123 myhost')
+        hostname.return_value = 'myhost'
         host = iceprod.core.functions.gethostname()
         self.assertEqual(host, 'myhost')
-        self.assertEqual(http_mock.call_count, 1)
 
-        http_mock.get('/downloads/getip.php', text='123 dyn.test.com')
+        hostname.return_value = 'myhost.test.com'
         host = iceprod.core.functions.gethostname()
         self.assertEqual(host, 'myhost.test.com')
-        self.assertEqual(http_mock.call_count, 2)
 
         fqdn.return_value = 'myhost.foo.bar'
         host = iceprod.core.functions.gethostname()
         self.assertEqual(host, 'myhost.test.com')
-        self.assertEqual(http_mock.call_count, 3)
 
         fqdn.return_value = 'myhost.foo.bar.baz'
         host = iceprod.core.functions.gethostname()
-        self.assertEqual(host, 'myhost.test.com')
-        self.assertEqual(http_mock.call_count, 4)
+        self.assertEqual(host, 'myhost.foo.bar.baz')
 
     @unittest_reporter
     def test_302_isurl(self):

remove getip.php request
This request: http://simprod.icecube.wisc.edu/downloads/getip.php
is on an old SL6 server.  We'd like to decommission that server.  Replace this lookup with something else, or remove entirely.
tests/core/functions_test.py::functions_test::test_301_gethostname
tests/core/functions_test.py::functions_test::test_001_uncompress tests/core/functions_test.py::functions_test::test_002_uncompress_tar tests/core/functions_test.py::functions_test::test_003_uncompress_tar tests/core/functions_test.py::functions_test::test_020_iscompressed tests/core/functions_test.py::functions_test::test_021_istarred tests/core/functions_test.py::functions_test::test_100_md5sum tests/core/functions_test.py::functions_test::test_101_check_md5sum tests/core/functions_test.py::functions_test::test_102_sha1sum tests/core/functions_test.py::functions_test::test_103_check_sha1sum tests/core/functions_test.py::functions_test::test_104_sha256sum tests/core/functions_test.py::functions_test::test_105_check_sha256sum tests/core/functions_test.py::functions_test::test_106_sha512sum tests/core/functions_test.py::functions_test::test_107_check_sha512sum tests/core/functions_test.py::functions_test::test_200_removedirs tests/core/functions_test.py::functions_test::test_201_copy tests/core/functions_test.py::functions_test::test_300_getInterfaces tests/core/functions_test.py::functions_test::test_302_isurl tests/core/functions_test.py::functions_test::test_304_download tests/core/functions_test.py::functions_test::test_305_download tests/core/functions_test.py::functions_test::test_320_download tests/core/functions_test.py::functions_test::test_404_upload tests/core/functions_test.py::functions_test::test_405_upload tests/core/functions_test.py::functions_test::test_410_upload tests/core/functions_test.py::functions_test::test_420_upload tests/core/functions_test.py::functions_test::test_504_delete tests/core/functions_test.py::functions_test::test_505_delete tests/core/functions_test.py::functions_test::test_510_delete