Ok, I have the same error. So I used one chef server, which is located on the Onpremise "Z" server and tried to load node "X". So I wrote a cookbook that records the host names and ipaddresses of all clients, which include the ip and hostname of server "Y" in /etc/hosts .
So what am I to blame.
I downloaded nodes in the cloud with the chef server, which is located on Onpremise. I changed the network interface "Y" and forgot that the client ip, which is them with "Z", is different from the real one. Later I tried to load "X" with "Y", but since X /etc/hosts contains the old ip Y, it could not find the route for the host, as it tried to use the old ip.
Then I tried changing the old IP address in /etc/hosts and running chef-client again, then everything went well. Hope this helps you.
Remember that you may encounter this error even when cname points to a different IP address and not to it.
Therefore, whenever you get this error, try ssh to the chef server from node, you want to run chef-client and see if you can connect. If this is not connected, then this is the same as I explained above
source share