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 / C++ / MFC
  4. Getting client computer name using its IP

Getting client computer name using its IP

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminhelpquestion
3 Posts 3 Posters 0 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.
  • S Offline
    S Offline
    sunny_vc
    wrote on last edited by
    #1

    Hi, I am working on a TCP server application. Can I get the computer name of a connected client using its IP? I am using getnameinfo(), but its giving only the IP. I want to get the computer name as I already having the client IP. Please help me.

    Regards, Sunil Kumar

    S E 2 Replies Last reply
    0
    • S sunny_vc

      Hi, I am working on a TCP server application. Can I get the computer name of a connected client using its IP? I am using getnameinfo(), but its giving only the IP. I want to get the computer name as I already having the client IP. Please help me.

      Regards, Sunil Kumar

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      getnameinfo[^]?

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      1 Reply Last reply
      0
      • S sunny_vc

        Hi, I am working on a TCP server application. Can I get the computer name of a connected client using its IP? I am using getnameinfo(), but its giving only the IP. I want to get the computer name as I already having the client IP. Please help me.

        Regards, Sunil Kumar

        E Offline
        E Offline
        Emilio Garavaglia
        wrote on last edited by
        #3

        The getnameinfo API ask the DNS for the IP to Name resolution. In general, getting a name from an IP requires a reverse DNS lookup to be configured in the DNS. That's not granted to happen for clients and dynamic addresses across the Internet. It works properly only if you are in coherently administrated network. Otherwise it is mostly impossible. Have a talk with your network administrator on how DNS works in your company.

        2 bugs found. > recompile ... 65534 bugs found. :doh:

        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