Skip to content

Commit

Permalink
Fix nameserver format (iphelix/dnschef#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3bl33d3r committed Sep 28, 2023
1 parent e1daa02 commit ada31cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dnschef/kitchen.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ipaddress import ip_address
from typing import List

import re
import socket
import asyncio
import functools
Expand Down Expand Up @@ -180,7 +181,7 @@ def datagram_received(self, data, addr):
else:
logger.info(f"proxying response", type=qtype, name=qname)

nameserver_tuple = random.choice(self.nameservers).split('#')
nameserver_tuple = re.split('[:#]', random.choice(self.nameservers))

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

0 comments on commit ada31cc

Please sign in to comment.