Thread: Domain Resolution :: Winsock

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    Domain Resolution :: Winsock

    Hi.

    I have a questions about resolving an IP into its domain name and vice versa. For example,

    IP: 66.218.71.84
    Domain: w5.scd.yahoo.com

    I am familiar with a solution for the example above. However, there are some IP that I cannot get the domain names. For example and this is something I am making up.

    IP: 28.116.90.40
    Domain: CORENT_WIN2k

    When I try to resolve 28.116.90.40 using the solution I currently use, the winsock API function returns 28.116.90.40 instead of CORENT_WIN2k. The only program I know that returns the corrent domain name is mIRC (a chat program).

    I use getaddrinfo() and getnameinfo(). Again, the solution works well except for some weird IP addresses similar to the one I made up.

    I would like to know is there a parameter somewhere for getaddrinfo() and/or getnameinfo() that will solve the solution example? Or maybe is there another technique?

    Thanks,
    Kuphryn

  2. #2
    Registered User
    Join Date
    Jul 2002
    Posts
    273
    I don't have a reason for you but I have seen that in the past. It's a reverse lookup thing at the DNS isn't it? getaddrinfo and getnameinfo hit a DNS don't they? does it somehow depend on what DNS you're trying to hit? Perhaps the IRC is hitting the IRC server's DNS for the info?
    always looking, make an offer. get me out of this place.

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    I am not sure what algorithm is in mIRC for resolving domain names.

    Kuphryn

  4. #4
    Registered User
    Join Date
    Jul 2002
    Posts
    273
    well the methods you mentioned are the only one's I've seen for winsock. It seems plausable the IRC has a server that will do the DNS lookup for you. As far as I know, you can only ask your own DNS directly.
    always looking, make an offer. get me out of this place.

  5. #5
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Ahhhh. Interesting. Thanks for the insight.

    Kuphryn

  6. #6
    Registered User
    Join Date
    Jul 2002
    Posts
    273

    Thumbs up

    disposable insight. possibly incorrect insight. But any time!
    always looking, make an offer. get me out of this place.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help problem in winsock code
    By lolguy in forum C Programming
    Replies: 8
    Last Post: 02-12-2009, 07:33 PM
  2. Winsock issues
    By tjpanda in forum Windows Programming
    Replies: 3
    Last Post: 12-04-2008, 08:32 AM
  3. Winsock Messaging Program
    By Morgul in forum Windows Programming
    Replies: 13
    Last Post: 04-25-2005, 04:00 PM
  4. Where do I initialize Winsock and catch messages for it?
    By Lithorien in forum Windows Programming
    Replies: 10
    Last Post: 12-30-2004, 12:11 PM
  5. MSN Vital Information
    By iain in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 09-22-2001, 08:55 PM