Can ping IP address and nslookup hostname but cannot ping hostname temporarily in Windows

I faced the same problem in my network. When you use this command:

ping icecream

It uses WINS server since you have used icecream not icecream.my.domain.

When looking for such words, Windows looks for NETBIOS names, but when you look for complete domain records, it will look in the DNS server. You can use one of the solutions below:

  1. Make sure you have correct records for that station in your WINS server.
  2. Use the complete domain name instead of using the host file. E.g. icecream.my.domain

You don't have DNS suffixes configured. Either configure them, or use FQDN like this and it should work:

ping icecream.my.domain