PowerShell - get only hostname from IP address

Sebastian Jesior 166 Reputation points
2023-01-12T10:53:38.92+00:00

Hello All,

I have starte learnig powershell and for this reason I'm not very good at it. May I kindly ask you to help me resolve this issue?

I would like to get ony hostname (only client.test.com) not all information which you can see on screen below:

enter image description here

Could you advice please?

Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. TP 124.7K Reputation points Volunteer Moderator
    2023-01-12T11:02:19.67+00:00

    Hi,

    Please see sample below:

    Resolve-DnsName -Name 192.168.247.200|select NameHost
    

    Thanks.

    -TP

    3 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

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.