Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. get host name from Ip address

get host name from Ip address

Scheduled Pinned Locked Moved C#
question
5 Posts 5 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello everybody, i have an ip address. Now how can i get it's host name. Thanks

    If you can think then I Can.

    R N P 3 Replies Last reply
    0
    • L Lost User

      Hello everybody, i have an ip address. Now how can i get it's host name. Thanks

      If you can think then I Can.

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      DNS.GetHostByAddress[^]. FYI - C# is not my primary competency. No prizes for guessing how did I find an answer. :rolleyes:

      "Real men drive manual transmission" - Rajesh.

      A 1 Reply Last reply
      0
      • L Lost User

        Hello everybody, i have an ip address. Now how can i get it's host name. Thanks

        If you can think then I Can.

        N Offline
        N Offline
        Nuri Ismail
        wrote on last edited by
        #3

        You can use: - Dns.GetHostEntry[^] - Dns.GetHostByAddress[^] The second method is obsolete and using the first alternative is recommended but you will see these details in documentation. :)

        1 Reply Last reply
        0
        • R Rajesh R Subramanian

          DNS.GetHostByAddress[^]. FYI - C# is not my primary competency. No prizes for guessing how did I find an answer. :rolleyes:

          "Real men drive manual transmission" - Rajesh.

          A Offline
          A Offline
          Abhinav S
          wrote on last edited by
          #4

          Precise answer. :)

          The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick

          1 Reply Last reply
          0
          • L Lost User

            Hello everybody, i have an ip address. Now how can i get it's host name. Thanks

            If you can think then I Can.

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            If it's your address wouldn't it be your name? :confused:

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups