About Me

My photo
I am MCSE in Data Management and Analytics with specialization in MS SQL Server and MCP in Azure. I have over 13+ years of experience in IT industry with expertise in data management, Azure Cloud, Data-Canter Migration, Infrastructure Architecture planning and Virtualization and automation. Contact me if you are looking for any sort of guidance in getting your Infrastructure provisioning automated through Terraform. I sometime write for a place to store my own experiences for future search and read by own blog but can hopefully help others along the way. Thanks.

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.