Skip to content

Commit 54cdc8f

Browse files
committed
bug fix in blocklist search
1 parent ec443bf commit 54cdc8f

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
2-
<img alt="Version Badge" src="https://img.shields.io/badge/dev--version-v5.1.0-16a085">
3-
<img alt="Version Badge" src="https://img.shields.io/badge/release-v5.1.0-16a085">
2+
<img alt="Version Badge" src="https://img.shields.io/badge/dev--version-v5.1.1-16a085">
3+
<img alt="Version Badge" src="https://img.shields.io/badge/release-v5.1.1-16a085">
44
<img alt="Docker Image Version" src="https://img.shields.io/docker/v/ryzeondev/bmdns?label=docker-version&color=16a085">
55
<img alt="License Badge" src="https://img.shields.io/github/license/ryzeon-dev/bmdns?color=16a085">
66
<img alt="Language Badge" src="https://img.shields.io/badge/python3-16a085?logo=python&logoColor=16a085&labelColor=5a5a5a">
@@ -68,7 +68,7 @@ The installation script
6868
### Debian
6969
Run the following line in a dedicated directory
7070
```commandline
71-
wget https://github.com/ryzeon-dev/bmdns/releases/download/v5.1.0/bmdns_5.1.0_amd64.deb && sudo dpkg -i ./bmdns_5.1.0_amd64.deb
71+
wget https://github.com/ryzeon-dev/bmdns/releases/download/v5.1.1/bmdns_5.1.1_amd64.deb && sudo dpkg -i ./bmdns_5.1.1_amd64.deb
7272
```
7373

7474
Warning: the executables were compiled and packed into .deb on Debian 13, the package might not work on older Debian releases (because of glibc versions)

src/Conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from StaticVlan import StaticVlan
77
from StaticRemap import StaticRemap
8+
from qtype import QTYPE
89
from utils import logFatalError
910
from validation import validateIPv4
1011

@@ -169,6 +170,10 @@ def search(self, target: str, qtype: int) -> str|None:
169170
if remap := wildcard.has(target, qtype):
170171
return remap
171172

173+
# blocklist only supports A requests
174+
if qtype != QTYPE.A:
175+
return None
176+
172177
for pattern, ip in self.blocklist.items():
173178
if re.match(pattern, target):
174179
return ip

src/DNS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def assembleResponse(data, type=QTYPE.A):
100100

101101
# searches for the domain and qtype in the vlan configuration
102102
if (target := staticVlan.search(qname, qtype)):
103-
self.logger.log(f'{strRequestId} | giving static vlan `{staticVlan.name}` answer "{target}" to {fmtClientAddress} asking for {qname} [{qtype}]')
103+
self.logger.log(f'{strRequestId} | giving static vlan `{staticVlan.name}` answer "{target}" to {fmtClientAddress} asking for {qname} [{QTYPE.codeToName(qtype)}]')
104104
responseBytes = assembleResponse(target, qtype)
105105

106106
try:

0 commit comments

Comments
 (0)