Skip to content
Discussion options

You must be logged in to vote

Aaaaah, was so close! The script itself was simply incomplete/buggy.

Found in the logs (via http://${mitmIp}:8081/#/flows?e=true) a Python error like:

Traceback (most recent call last):
File "/home/mitmproxy/.mitmproxy/custom-dns.py", line 8, in dns_request
dns.ResourceRecord.A(
^^^
NameError: name 'dns' is not defined

And proceeded from there. Basically the example I found was missing a whole bunch of imports. The official example https://docs.mitmproxy.org/stable/addons/examples/#dns-simple which I've now found would have been a better starting point. Combining what I'd started with, with what it needed to be as:

from ipaddress import ip_address
from mitmproxy import dns
import logging

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by natevw
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants