Hello @Mohamed Shehata Elbeltagy ,
Thank you for reaching out to the Microsoft Q&A platform. Happy to answer your question.
Hosts file does not use nslookup sure, but when the DNS records are referenced, they go in this order Hosts file > DNS Server, which host file being the first place we check. When you try to log into a source machine, it's the Source Machine that references ITS DNS server not the Appliance itself. The Appliance just needs to resolve the Private Endpoint addresses and have line of sight to the VM.
Hope this helps!
If you have any questions at all, let us know in the comments.
If the answer provided by has helped, please 'Accept as Answer' and Upvote using "Thumbs-up" so that it can improve discoverability for others in the community looking for help on the same topic.