when auditing what are the failing logins in one of my server, using the sp_readerrorlog procedure I get the following result, when running the following query:
EXEC sp_readerrorlog 0, 1, 'Login failed'
it shows me the IP address of the servers where from the login was attempted.
I know that ping -a
resolve ip addresses to hostnames
any ideas, even vague ones, or indications, as how I could get to those hostnames using T-SQL?
lets, say I can get to the ip address and put it into a variable. how then could I go and do a magic and get to the hostname for that particular ip address?
Best Answer
As other comments on your question indicated, there are probably better ways other than TSQL to get this data, but here is something I cobbled together using TSQL.