Skip to content

Commit c2c7cc2

Browse files
authored
Merge pull request #1 from SuperDuperRob/master
Many tweaks and improvements :)
2 parents 3e31de5 + 349ec82 commit c2c7cc2

File tree

6 files changed

+57
-84
lines changed

6 files changed

+57
-84
lines changed

README.md

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,47 @@
1-
# sudomemoDNS
2-
3-
This server will allow you to connect to Sudomemo when
4-
your Internet Service Provider does not work with custom DNS.
1+
![sudomemoDNS Logo](/sudomemoDNS_banner.png)
2+
### This server will allow you to connect to Sudomemo when your Internet Service Provider does not work with custom DNS.
53

64
## Setup
75

8-
The setup process does not differ from what is shown at
9-
https://support.sudomemo.net/setup except for the values
10-
to enter in your custom DNS settings.
11-
12-
First, make sure that your Nintendo DSi is connected to the
13-
same network as this computer.
6+
The setup process does not differ from what is shown at https://flipnot.es/setup except for the values to enter in your custom DNS settings.
7+
First, make sure that your console is connected to the same network as this computer.
8+
Please submit any issues to Sudomemo Support.
149

15-
This is the initial release of sudomemoDNS. Please submit any issues to Sudomemo Support.
16-
17-
# Running on Windows:
10+
## Running on Windows:
1811

1912
Run the .exe provided in this release. You may have to click past a warning from Windows SmartScreen (as it sometimes turns its nose up at applications bundled by PyInstaller) or your firewall (as it needs to listen for DNS requests).
2013

21-
# Running on anything else:
14+
## Running on anything else:
2215

2316
Required packages (installable with pip): requests, dnslib
2417
Required Python version: 3+, tested with 3.6
2518

2619
sudo <name of your python binary> sudomemoDNS.py
2720

28-
# What you'll see when it starts up
21+
## What you'll see when it starts up
2922

3023
The following will display when you start it up:
3124

3225
+===============================+
3326
| Sudomemo DNS Server |
34-
| Version 1.0 |
27+
| Version 1.1 |
3528
+===============================+
36-
37-
Hello! This server will allow you to connect to Sudomemo when
38-
your Internet Service Provider does not work with custom DNS.
39-
40-
#### How To Use ####
41-
42-
The setup process does not differ from what is shown at
43-
https://support.sudomemo.net/setup except for the values
44-
to enter in your custom DNS settings.
45-
46-
First, make sure that your Nintendo DSi is connected to the
47-
same network as this computer.
48-
49-
Here are the settings you will put in for DNS on your Nintendo DSi:
50-
51-
Primary DNS: XX.XX.XX.XX (NOTE: this value will be unique when you run the program)
29+
30+
== Welcome to sudomemoDNS! ==
31+
This server will allow you to connect to Sudomemo when your Internet Service Provider does
32+
not work with custom DNS.
33+
34+
== How To Use ==
35+
First, make sure that your console is connected to the same network as this computer.
36+
37+
Then, put these settings in for DNS on your console:
38+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39+
Primary DNS: XXX.XXX.XXX.XXX (NOTE: This value will be unique when you run the program)
5240
Secondary DNS: 8.8.8.8
53-
All other settings should match what is shown at the above URL.
54-
55-
#### Getting Help ####
56-
57-
Need help? Visit our Discord server or check out https://support.sudomemo.net.
41+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5842

43+
== Getting Help ==
44+
Need help? Visit our Discord server or check out https://support.sudomemo.net
5945

6046
When entering your DNS settings, if the Primary DNS is displayed like this (this is an example):
6147

@@ -65,10 +51,9 @@ then you can enter it as follows:
6551

6652
192.168.001.007
6753

54+
## Building on Windows
6855

69-
# Building on Windows
70-
71-
Install dnslib and requests via pip (as well as pyinstaller) and then build with pyinstaller:
56+
Install dnslib, requests, and pyinstaller via pip, then modify the paths in the spec file to where sudomemoDNS and the sudomemoDNS icon is stored.
57+
Then, run the following as an administrator:
7258

73-
C:\Users\Administrator\sudomemo-dns>C:\Users\Administrator\AppData\Local\Programs\Python\Python36\Scripts\pyinstaller.exe sud
74-
omemoDNS_v1.0.spec
59+
pyinstaller.exe sudomemoDNS_v1.1.spec

sudomemo.ico

-131 KB
Binary file not shown.

sudomemoDNS.py

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# sudomemoDNS v1.0
2-
# (c) 2019 Austin Burk/Sudomemo
1+
# sudomemoDNS v1.1
2+
# (c) 2019-2020 Austin Burk / Team Sudomemo
33
# All rights reserved
44

55
from datetime import datetime
@@ -18,15 +18,15 @@ def get_platform():
1818
platforms = {
1919
'linux1' : 'Linux',
2020
'linux2' : 'Linux',
21-
'darwin' : 'OS X',
21+
'darwin' : 'macOS',
2222
'win32' : 'Windows'
2323
}
2424
if sys.platform not in platforms:
2525
return sys.platform
2626

2727
return platforms[sys.platform]
2828

29-
SUDOMEMODNS_VERSION = "1.0"
29+
SUDOMEMODNS_VERSION = "1.1"
3030

3131
def get_ip():
3232
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@@ -49,27 +49,22 @@ def get_ip():
4949
print("| Version " + SUDOMEMODNS_VERSION + " |")
5050
print("+===============================+\n")
5151

52-
print("Hello! This server will allow you to connect to Sudomemo when")
53-
print("your Internet Service Provider does not work with custom DNS.\n")
52+
print("== Welcome to sudomemoDNS! ==")
53+
print("This server will allow you to connect to Sudomemo when your Internet Service Provider does not work with custom DNS.\n")
5454

55-
print("#### How To Use ####\n")
56-
print("The setup process does not differ from what is shown at")
57-
print("https://support.sudomemo.net/setup except for the values")
58-
print("to enter in your custom DNS settings.\n")
55+
print("== How To Use ==")
56+
print("First, make sure that your console is connected to the same network as this computer.\n")
5957

60-
print("First, make sure that your Nintendo DSi is connected to the")
61-
print("same network as this computer.")
62-
63-
print("\nHere are the settings you will put in for DNS on your Nintendo DSi:\n")
58+
print("Then, put these settings in for DNS on your console:")
59+
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
6460
print("Primary DNS: ",MY_IP)
6561
print("Secondary DNS: 8.8.8.8")
62+
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n")
6663

67-
print("All other settings should match what is shown at the above URL.\n")
68-
69-
print("#### Getting Help ####\n")
70-
print("Need help? Visit our Discord server or check out https://support.sudomemo.net.\n")
64+
print("== Getting Help ==")
65+
print("Need help? Visit our Discord server or check out https://support.sudomemo.net\n")
7166

72-
print("[INFO] Starting up")
67+
print("[INFO] Starting sudomemoDNS...")
7368

7469
TYPE_LOOKUP = {
7570
A: QTYPE.A,
@@ -89,17 +84,16 @@ def log_recv(self, handler, data):
8984
def log_send(self, handler, data):
9085
pass
9186
def log_request(self, handler, request):
92-
print("[INFO] Received DNS request from DSi at " + handler.client_address[0])
87+
print("[INFO] Received DNS request from console at " + handler.client_address[0])
9388
def log_reply(self, handler, reply):
94-
print("[INFO] Sent response to DSi at " + handler.client_address[0])
89+
print("[INFO] Sent response to console at " + handler.client_address[0])
9590
def log_error(self, handler, e):
96-
logger.error("[INFO] Invalid DNS request from " + handler.client_address[0])
91+
print("[ERROR] Invalid DNS request from " + handler.client_address[0])
9792
def log_truncated(self, handler, reply):
9893
pass
9994
def log_data(self, dnsobj):
10095
pass
10196

102-
10397
class Record:
10498
def __init__(self, rdata_type, *args, rtype=None, rname=None, ttl=None, **kwargs):
10599
if isinstance(rdata_type, RD):
@@ -154,17 +148,15 @@ def __str__(self):
154148
try:
155149
get_zones = requests.get("https://www.sudomemo.net/api/dns_zones.json", headers={'User-Agent': 'SudomemoDNS/' + SUDOMEMODNS_VERSION + ' (' + get_platform() + ')'})
156150
except requests.exceptions.Timeout:
157-
print("[ERROR] Couldn't load DNS data: connection to Sudomemo timed out.")
158-
print("[ERROR] Are you connected to the Internet?")
151+
print("[ERROR] Unable to load DNS data: Connection to Sudomemo timed out. Are you connected to the Internet?")
159152
except requests.exceptions.RequestException as e:
160-
print("[ERROR] Couldn't load DNS data.")
153+
print("[ERROR] Unable load DNS data.")
161154
print("[ERROR] Exception: ",e)
162155
sys.exit(1)
163156
try:
164157
zones = json.loads(get_zones.text)
165158
except ValueError as e:
166-
print("[ERROR] Couldn't load DNS data: invalid response from server")
167-
print("[ERROR] Check that you can visit sudomemo.net")
159+
print("[ERROR] Unable load DNS data: Invalid response from server. Check that you can visit sudomemo.net")
168160

169161
for zone in zones:
170162
if zone["type"] == "a":
@@ -203,35 +195,31 @@ def resolve(self, request, handler):
203195
resolver = Resolver()
204196
dnsLogger = SudomemoDNSLogger()
205197

206-
print("[INFO] Detected operating system:", get_platform());
198+
print("[INFO] Detected operating system:", get_platform())
207199

208200
if get_platform() == 'linux':
209201
print("[INFO] Please note that you will have to run this as root or with permissions to bind to UDP port 53.")
210202
print("[INFO] If you aren't seeing any requests, check that this is the case first with lsof -i:53 (requires lsof)")
211203
print("[INFO] To run as root, prefix the command with 'sudo'")
212-
elif get_platform() == 'OS X':
204+
elif get_platform() == 'macOS':
213205
print("[INFO] Please note that you will have to run this as root or with permissions to bind to UDP port 53.")
214206
print("[INFO] If you aren't seeing any requests, check that this is the case first with lsof -i:53 (requires lsof)")
215207
print("[INFO] To run as root, prefix the command with 'sudo'")
216208
elif get_platform() == 'Windows':
217-
print("[INFO] Please note: On Windows, you may have to allow this application through")
218-
print("[INFO] the firewall. If so, a popup will appear in a moment.")
219-
print("[INFO] If you aren't seeing any requests, make sure you have done so first.")
220-
print("[INFO] Disregard this message if you have already done so.")
209+
print("[INFO] Please note that you may have to allow this application through the firewall. If so, a popup will appear in a moment.")
210+
print("[INFO] If you are not seeing any requests, make sure you have allowed this application through the firewall. If you have already done so, disregard this message.")
221211

222212
try:
223213
servers = [
224214
DNSServer(resolver=resolver, port=53, address=MY_IP, tcp=True, logger=dnsLogger),
225215
DNSServer(resolver=resolver, port=53, address=MY_IP, tcp=False, logger=dnsLogger),
226216
]
227217
except PermissionError:
228-
print("[ERROR] Permission error: check that you are running this as Administrator or root")
218+
print("[ERROR] Permission error: Check that you are running this as an administrator or root")
229219
sys.exit(1)
230220

231221

232-
print("[INFO] Starting Sudomemo DNS server.")
233-
234-
print("[INFO] Now waiting for DNS requests from your Nintendo DSi System.")
222+
print("[INFO] sudomemoDNS is ready. Now waiting for DNS requests from your console...")
235223

236224
if __name__ == '__main__':
237225
for s in servers:
@@ -244,4 +232,4 @@ def resolve(self, request, handler):
244232
pass
245233
finally:
246234
for s in servers:
247-
s.stop()
235+
s.stop()

sudomemoDNS_banner.png

47.7 KB
Loading

sudomemoDNS_icon.ico

117 KB
Binary file not shown.

sudomemoDNS_v1.0.spec renamed to sudomemoDNS_v1.1.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ block_cipher = None
44

55

66
a = Analysis(['sudomemoDNS.py'],
7-
pathex=['C:\\Users\\Administrator\\sudomemo-dns'],
7+
pathex=['C:\\PATH\\TO\\SUDOMEMODNS'],
88
binaries=[],
99
datas=[],
1010
hiddenimports=[],
@@ -23,10 +23,10 @@ exe = EXE(pyz,
2323
a.zipfiles,
2424
a.datas,
2525
[],
26-
name='sudomemoDNS_v1.0',
26+
name='sudomemoDNS_v1.1',
2727
debug=False,
2828
bootloader_ignore_signals=False,
2929
strip=False,
3030
upx=True,
3131
runtime_tmpdir=None,
32-
console=True , icon='C:\\Users\\Administrator\\sudomemo-dns\\sudomemo.ico')
32+
console=True , icon='C:\\PATH\\TO\\SUDOMEMODNS\\ICON.ico')

0 commit comments

Comments
 (0)