Connecting to Mender without DNS, & 418 Status Code help

Hello,

I’m wondering if it’s possible to connect to a mender server directly through an IP rather than going through DNS (ie: with a URL). We’ve got devices that we’d like to lock down, but in the event DNS fails for any reason we may be unable to update them.

I’ve added the IP address we’re using to the ALLOWED_HOSTS environment variable on the server, however when I access the IP directly through a browser I am unhelpfully given the 418 status code (AKA “I am a teapot” which is a joke status code).

Firstly, is what we’re trying to do not possible/not recommended? And secondly, what can I do to get a status code that might help me diagnose what the issue is?

Connecting it from the client, you first will need to satisfy negotiation of the TLS handshake and certificate hostname verification.

Can you assume that your server IP won’t change?

Assuming it won’t change, then add the DNS and its IP to your clients /etc/hosts file, and then continue to use the DNS in the mender client config. However, this means you are no longer using external DNS at all, as you are using the local device’s resolver, this may not be what you want. Generally, I only use this for development work rather than production work, but your needs may vary.