About Me

My photo
I am an MCSE in Data Management and Analytics, specializing in MS SQL Server, and an MCP in Azure. With over 19+ years of experience in the IT industry, I bring expertise in data management, Azure Cloud, Data Center Migration, Infrastructure Architecture planning, as well as Virtualization and automation. I have a deep passion for driving innovation through infrastructure automation, particularly using Terraform for efficient provisioning. If you're looking for guidance on automating your infrastructure or have questions about Azure, SQL Server, or cloud migration, feel free to reach out. I often write to capture my own experiences and insights for future reference, but I hope that sharing these experiences through my blog will help others on their journey as well. Thank you for reading!

Database mirroring connection error 2 'DNS lookup failed with error: '11004(The requested name is valid, but no data of the requested type was found.)'.' Database Mirroring login attempt failed with error: 'Connection handshake failed. An OS call failed: (8009030c) 0x8009030c

Database Mirroring was in Disconnected state and when checked Errorlog file found below entry in Principal and Mirror Server



Error message in Principal Server:-
Database mirroring connection error 4 'An error occurred while receiving data: '10054(An existing connection was forcibly closed by the remote host.)'.' for 'TCP://192.168.1.2:7077'.

Database mirroring connection error 4 'An error occurred while receiving data: '64(The specified network name is no longer available.)'.' for 'TCP://MirrorServer:7077'.



Error Message in Mirror Server:-

Database mirroring connection error 2 'DNS lookup failed with error: '11004(The requested name is valid, but no data of the requested type was found.)'.' for 'TCP://PrincipalServer.STL.com:7077'.

Database Mirroring login attempt failed with error: 'Connection handshake failed. An OS call failed: (8009030c) 0x8009030c(The logon attempt failed). State 67.'.  [CLIENT: 192.168.1.2]


Very Good explanation  and how to resolve is written in below link 
Explanation

specifically if the error is



Database Mirroring login attempt failed with error: 'Connection handshake failed. An OS call failed: (8009030c) 0x8009030c(The logon attempt failed). State 67.'. [CLIENT: 192.168.1.26]


but in my case the main error was as below in Mirror Server..

Database mirroring connection error 2 'DNS lookup failed with error: '11004(The requested name is valid, but no data of the requested type was found.)'.' for 'TCP://PrincipalServer.STL.com:7077'.


so we have to figure out why there is a connection handshake problem when Mirror Server try to connect to the principal server.
Thre can be different reasons like
1.  Service account not having permission on a principal server etc.

Here in our scenario if we see the error which came just before connection handshake message is { 'DNS lookup failed with error: '11004' } which clearly indicates that DNS resolution for principal server name to its IP address was not successful from Mirror Server.

Hence this resulted in Mirror Server is not making a successful connection to the principal Server.

Workaround
---------------------
The Workaround to resolve this issue is to add  a Principal Server Name and its corresponding IP address entry in the host file on the Mirror Server and

in Mirror Server added  a Principal  Server Name and its corresponding IP address entry in the host file on the Mirror Server.

You will get Host File in location -- C:\Windows\System32\drivers\etc

From  C:\Windows\System32\drivers\etc open host file in notepad and add a Entry like this

In Mirror Server 
--------------------------------------
# localhost name resolution is handled within DNS itself.
# 127.0.0.1       localhost
# ::1             localhost
192.168.1.1 PrincipalServer.STL.com

Here 192.168.1.1 is the Principal Server IP address.
and
PrincipalServer.STL.com is Complete FQDN of principal Server.

And then try to resume mirroring for all disconnected database, in my case it has come online after.