Skip to content

Commit 521cd6a

Browse files
committed
internetradiofrontier.com domain, see #5
1 parent a1e8cc6 commit 521cd6a

File tree

6 files changed

+21
-11
lines changed

6 files changed

+21
-11
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Bug Report
3+
about: A bug report describes an error of Radio-DNS-Server or errors while using it.
4+
title: ''
5+
labels: bug
6+
assignees: kimbtech
7+
8+
---

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ The configuration is done using env variables.
2020
- `TIME_SERVER` *(optional, default `ntp0.fau.de`)* If the DNS server is queried for `time.wifiradiofrontier.com` it will answer with the `A` record of this domain. So one does not have to host an own NTP server at `RADIO_DOMAIN`. Per default some time server is used.
2121
- `ENABLE_UPDATE` *(optional, default `false`)* Set to `true` to enable responding to DNS queries for `update.wifiradiofrontier.com` with the `A` record of `update.wifiradiofrontier.com` instead of the ip of Radio-API. (This will allow the radio to do updates. Performing updates is a trade-off between risking changes to the API, that may prevent Radio-API from working, and bug fixes and security implications for the radio's software.)
2222

23+
Besides the domain `wifiradiofrontier.com` also the domain `internetradiofrontier.com` is considered as domain to tamper DNS queries for.
24+
2325
Run using the [**Docker-compose Example**](./docker-compose.yml)!
2426

2527
## Notice and Used Libraries

VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
2
2-
2.1
3-
2.1.1
2+
2.2
3+
2.2.0

dns/hama.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88

99
class Hama():
1010

11-
_DOMAIN = "wifiradiofrontier.com."
12-
_TIME_DOMAIN = "time.wifiradiofrontier.com."
13-
_UPDATE_DOMAIN = "update.wifiradiofrontier.com."
11+
_DOMAINS = ("wifiradiofrontier.com.", "internetradiofrontier.com.")
12+
_TIME_SUB_DOMAIN = "time.*"
13+
_UPDATE_SUB_DOMAIN = "update.*"
1414

1515
def __init__(self):
1616
self.do_lookup = Config["DO_LOOKUP"]
1717

1818
def match_domain(self, question:DNSQuestion) -> bool:
1919
if isinstance(question, DNSQuestion):
20-
if question.qname.matchSuffix(self._DOMAIN):
20+
if any(question.qname.matchSuffix(domain) for domain in self._DOMAINS):
2121
if question.qtype == QTYPE.A:
2222
return True
2323

2424
return False
2525

2626
def fetch_answer(self, question:DNSQuestion) -> Union[RR, None]:
27-
if question.qname.matchSuffix(self._TIME_DOMAIN):
27+
if question.qname.matchGlob(self._TIME_SUB_DOMAIN):
2828
ip_address = DNSClient.resolve_a(Config["TIME"])
29-
elif Config["UPDATE"] and question.qname.matchSuffix(self._UPDATE_DOMAIN):
30-
ip_address = DNSClient.resolve_a(self._UPDATE_DOMAIN)
29+
elif Config["UPDATE"] and question.qname.matchGlob(self._UPDATE_SUB_DOMAIN):
30+
ip_address = DNSClient.resolve_a(str(question.qname))
3131
else:
3232
ip_address = DNSClient.resolve_a(Config["RADIO"]) if self.do_lookup else Config["RADIO"]
3333

docker-compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
- SERVER_BIND=0.0.0.0
1515
- SERVER_UPSTREAM=8.8.8.8
1616
- SERVER_PORT=53
17-
- RADIO_DOMAIN=example.com
17+
#- RADIO_DOMAIN=example.com
1818
- RADIO_IP=192.168.0.41
1919
- ALLOWED_DOMAIN=all
2020
- TIME_SERVER=ntp0.fau.de

run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
if Config["DEVMODE"]:
1111
print("Devmode enabled, no server will be started!")
12-
print("\tAttach to container and start manually.")
12+
print("\tAttach to container and start manually, i.e., 'python -m dns.server'")
1313

1414
while True:
1515
time.sleep(1)

0 commit comments

Comments
 (0)