Trying connect azure mysql flex server using mysql workbench using dns but it works with ip address

Anu Harshan 20 Reputation points
2025-08-04T20:36:11.06+00:00

Trying to connect Azure mysqlflex server using mysql workbench using DNS Here is the error I am getting "unknown mysql server host"

Azure Database for MySQL
{count} votes

1 answer

Sort by: Most helpful
  1. Smaran Thoomu 28,225 Reputation points Microsoft External Staff Moderator
    2025-08-04T21:32:44.5433333+00:00

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.