Regularly I receive from my server these kind of errors:
Invalid HTTP_HOST header: '139.162.113.11'. You may need to add '139.162.113.11' to ALLOWED_HOSTS.
The problem is that my server works fine and I don't know where do these IP addresses are coming from.
If I try to localize the one in example, it appears to be in Tokyo, which is weird to me, having a server based in France for mainly european customers.
Can't it be a suspicious attempt to the server security? I'm not keen to allow this IP. What is the correct attitude toward this kind of error?
You can "trust" that Django is helping prevent your app from running on disallowed hosts!
However- you can't blindly trust that these IPs should be allowed to host your application. They're typically some kind of bot scanning services poking around for vulnerabilities in servers to do nasty things.
Heck- I have a few of these DISALLOWED_HOST warnings in my inbox this morning as I wake up!
There is a logging option django.security.DisallowedHost where you can quiet this issue- however I keep it on as a barometer for bot activity.