DNS Logger and Forwarder v2.0
Budget: $30 – $250 USD
This is a private group for: DNS forwarder and logger script that should support the below requirements:
Step 1 - Script starts working and then identifies public NAT IP address using https://whatismyipaddress.com/ (variable a).
Step 2 - Script listening for DNS queries.
Step 3 - DNS query hits the server where the script is
running and listening on port 53 UDP.
Step 4 - The script extracts the following fields (variables: b, c & d respectively): 1) the source IP address of the DNS query 2) the domain name in the dns query 3) the DNS record type in the query.
Step 5 - Establishes secure SSH session with remote Linux server and writes the extracted variables above along with time stamp in a text file (syntax: variables A, B, C, D, Time Stamp).
Step 6 - Maintains a session table of DNS queries. Forwards the DNS query to defined list of remote DNS servers. Wait for the response from the remote DNS servers, sends back the response to the DNS query initiator.
Attached diagram explains the desired operational steps of the script.
Error Handling:
- DNS forwarding service part (steps 2, 3, 4 & 6) in the script should alway continue to function despite errors or failures in contacting whatismyipaddress.com and/or establishing SSH session (steps 1 & 5). In other words, unable to process step 1 or 5 shouldn’t prevent from processing steps 2, 3, 4 & 6. Example loosing SSH disconnection shouldn’t prevent script from serving DNS forwarding.
- Script should always re-attempt the execution of any failed step.
Attached diagram explains the desired operational steps of the script.
Notes:
- The script should utilize multi threading for high rate DNS environments.
- Script to be written in Python3
- Notes along with running steps to be added.
- Script should support running using Linux Ubuntu.
Step 1 - Script starts working and then identifies public NAT IP address using https://whatismyipaddress.com/ (variable a).
Step 2 - Script listening for DNS queries.
Step 3 - DNS query hits the server where the script is
running and listening on port 53 UDP.
Step 4 - The script extracts the following fields (variables: b, c & d respectively): 1) the source IP address of the DNS query 2) the domain name in the dns query 3) the DNS record type in the query.
Step 5 - Establishes secure SSH session with remote Linux server and writes the extracted variables above along with time stamp in a text file (syntax: variables A, B, C, D, Time Stamp).
Step 6 - Maintains a session table of DNS queries. Forwards the DNS query to defined list of remote DNS servers. Wait for the response from the remote DNS servers, sends back the response to the DNS query initiator.
Attached diagram explains the desired operational steps of the script.
Error Handling:
- DNS forwarding service part (steps 2, 3, 4 & 6) in the script should alway continue to function despite errors or failures in contacting whatismyipaddress.com and/or establishing SSH session (steps 1 & 5). In other words, unable to process step 1 or 5 shouldn’t prevent from processing steps 2, 3, 4 & 6. Example loosing SSH disconnection shouldn’t prevent script from serving DNS forwarding.
- Script should always re-attempt the execution of any failed step.
Attached diagram explains the desired operational steps of the script.
Notes:
- The script should utilize multi threading for high rate DNS environments.
- Script to be written in Python3
- Notes along with running steps to be added.
- Script should support running using Linux Ubuntu.