Hi Anu Harshan
Thanks for sharing the issue.
The error "Unknown MySQL server host" when using the DNS name usually points to a DNS resolution issue. Since you're able to connect using the IP address, here are a few things to check:
- Verify DNS Format: Make sure you're using the full FQDN of the server (e.g.,
your-server-name.mysql.database.azure.com
). - Network Configuration:
- If you're connecting from an on-premises machine or custom VNet, ensure DNS resolution is properly set up.
- Try running
nslookup your-server-name.mysql.database.azure.com
from your machine to verify if DNS resolves.
- Firewall or Proxy Restrictions:
- Ensure outbound DNS (port 53) is not blocked by your network.
- If behind a corporate firewall or proxy, test from a different network or use a public DNS (like 8.8.8.8) to rule this out.
- Local Hosts File Conflict: Sometimes a misconfigured
hosts
file entry can block proper DNS resolution.
I hope this information helps. Please do let us know if you have any further queries.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.