Skip to content

Commit ada31cc

Browse files
committed
Fix nameserver format (iphelix/dnschef#25)
1 parent e1daa02 commit ada31cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dnschef/kitchen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from ipaddress import ip_address
55
from typing import List
66

7+
import re
78
import socket
89
import asyncio
910
import functools
@@ -180,7 +181,7 @@ def datagram_received(self, data, addr):
180181
else:
181182
logger.info(f"proxying response", type=qtype, name=qname)
182183

183-
nameserver_tuple = random.choice(self.nameservers).split('#')
184+
nameserver_tuple = re.split('[:#]', random.choice(self.nameservers))
184185

185186
task = asyncio.create_task(proxyrequest(data, *nameserver_tuple))
186187
task.add_done_callback(functools.partial(lambda c, t, a: t.sendto(c.result(), a), t=self.transport, a=addr))

0 commit comments

Comments
 (0)