diff --git a/designate/mdns/notify.py b/designate/mdns/notify.py index b7c3632ea..ed842e6d8 100644 --- a/designate/mdns/notify.py +++ b/designate/mdns/notify.py @@ -309,4 +309,9 @@ class NotifyEndpoint(base.BaseEndpoint): :return: response """ send = dns_query.tcp if CONF['service:mdns'].all_tcp else dns_query.udp - return send(dns_message, host, port=port, timeout=timeout) + return send( + dns_message, + socket.gethostbyname(host), + port=port, + timeout=timeout + ) diff --git a/designate/tests/unit/test_mdns/test_notify.py b/designate/tests/unit/test_mdns/test_notify.py index e61dc4725..e9c81a558 100644 --- a/designate/tests/unit/test_mdns/test_notify.py +++ b/designate/tests/unit/test_mdns/test_notify.py @@ -266,9 +266,9 @@ class MdnsNotifyTest(base.BaseTestCase): @mock.patch.object(notify.dns_query, 'tcp') @mock.patch.object(notify.dns_query, 'udp') def test_send_dns_message(self, *mocks): - out = self.notify._send_dns_message('msg', 'host', 123, 1) + out = self.notify._send_dns_message('msg', '192.0.2.1', 1234, 1) assert not notify.dns_query.tcp.called - notify.dns_query.udp.assert_called_with('msg', 'host', port=123, + notify.dns_query.udp.assert_called_with('msg', '192.0.2.1', port=1234, timeout=1) assert isinstance(out, Mock)