Since upgrading my laptop to Window 11 connecting to openHABian via ssh and rest API calls made via curl on the command line appear to hang for ~20s before being actioned. Prior to upgrade it was instantaneous.
For example, if I start the connection using puTTy, the console window is blank for 20s and then starts working, after that the connection works as expected. The same is true if I run a curl command from the command line. I tried investigating the delay using -v --trace, but this showed nothing for 20s, then the actual request is done in a few milliseconds. It seems to be hanging before attempting to connect to openHAB. Here’s the output:
C:\Users\martii>curl -v --trace-time --header "Content-Type: text/plain" --header "Accept: application/json" -d "ON" "http://openhabian:8080/rest/items/d_lamp1T"
09:08:29.466000 * Trying 192.168.1.221:8080...
09:08:29.470120 * Connected to openhabian (192.168.1.221) port 8080 (#0)
09:08:29.471818 > POST /rest/items/d_lamp1T HTTP/1.1
09:08:29.471818 > Host: openhabian:8080
09:08:29.471818 > User-Agent: curl/7.83.1
09:08:29.471818 > Content-Type: text/plain
09:08:29.471818 > Accept: application/json
09:08:29.471818 > Content-Length: 2
09:08:29.471818 >
09:08:29.481454 * Mark bundle as not supporting multiuse
09:08:29.483686 < HTTP/1.1 200 OK
09:08:29.485051 < Content-Type: text/plain
09:08:29.486951 < Date: Wed, 22 Mar 2023 09:08:29 GMT
09:08:29.488690 < Content-Length: 0
09:08:29.490008 < Server: Jetty(9.4.46.v20220331)
09:08:29.491636 <
09:08:29.492624 * Connection #0 to host openhabian left intact
Thanks all for your comments and suggestions. @JimT you nailed it; using the IP address instead of hostname brought back instantaneous functionality.
I could just start using that but I have quite a few scripts and settings to wade through so would prefer to find the root cause of the DNS lookup delay. Any idea of what might cause this?
This all started happening when I upgrade form Win 10 to 11, but I can’t see any other reports of this DNS issues related to the new operating system.
It’s been a while since I posted but actually the problem has returned. It may have been a fluke that it connected faster last time. I’ve now tried opening ports 22, 8080 and 53
Not only is there a 30s delay before the SSH client connects, but the same delay is seen when connecting to samba shares in Windows Explorer. Even going to openHAB in a browser (openhabian:8080) waits 30s before connecting. My Windows 10 PC on the same network does all these things instantly. Both are connected via ethernet.
Yes, it has the same delay when using HTTP on port 8080.
It’s a work laptop so I can’t get too deep into firewall settings. I believe it’s manage by Sophos Intercept X. I can change Windows Firewall settings, but Sophos probably has its own.
The odd thing is that I had the same security installed on Windows 10 and it was the switch to 11 that caused the issue.
I’m not too familiar with openhabian and what it does to make http://openhabian:8080 resolvable - does it inject that into the local DNS server, where does that exist, and is it configured for DDNS? Is your Windows using that same local dns server for name resolution? Or perhaps Windows appends the .local to the dns lookups when lookup for just a plain openhabian failed, and that might explain the delay