Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python-amcrest triggers a DNS lookup for every command #237

Open
dunedain289 opened this issue Aug 3, 2024 · 0 comments
Open

python-amcrest triggers a DNS lookup for every command #237

dunedain289 opened this issue Aug 3, 2024 · 0 comments

Comments

@dunedain289
Copy link

I'm using the HomeAssistant Amcrest integration, and my OPNsense router was showing 10000's of queries for my camera DNS names. My cameras have static DHCP assignments, which puts the hostname in Unbound with a 3600s TTL. I expected to see maybe 100 queries per day, but HA was generating ~300 queries per second to the camera names. Changing my HA config to IP addresses solved the problem, and I'm not seeing constant queries.

I think requests is triggering a new DNS lookup every time through this function/loop (i.e. for every single command):

https://github.com/tchellomello/python-amcrest/blob/master/src/amcrest/http.py#L290-L304

Caching the session between calls might help, but I'm not enough of a requests expert to be certain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant