DNS lookup?

This is a discussion on DNS lookup? within the Networking/Device Communication forums, part of the General Programming Boards category; How do I write my own DNS lookup to list all sub domains on a host. Because you see i ...

  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    DNS lookup?

    How do I write my own DNS lookup to list all sub domains on a host.
    Because you see i want to write an smtp server, but as i've learned, after i send mail with my smtp server, it sends mail to the destination's smtp server. but how my smtp server finds the destination's smtp server's address?
    So I did a little reasearch and I found out that it's done with dns lookup, but i could not find a manual on how to do that.

    Please help.
    Thanks.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    You need to lookup mx dns records. MX is short for Mail Exchange. These records point to the incoming smtp server for a domain.

    Some operating systems have apis to lookup mx records. For example, DnsQuery is available on Windows 2000/XP. Alternatively you can use a library or just some code using sockets.

    C code using sockets:
    http://cvs.synchro.net/cgi-bin/viewc...bs3/mxlookup.c

    DnsQuery function:
    http://www.developer2.com/features/stories/34508.html

  3. #3
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    Thanks alot.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DNS issue
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 08-02-2008, 11:15 AM
  2. Lookup in lists
    By agentsmith in forum C Programming
    Replies: 1
    Last Post: 12-07-2007, 02:14 PM
  3. gethostbyaddr() reverse lookups failing (???)
    By Uncle Rico in forum C Programming
    Replies: 9
    Last Post: 08-19-2005, 10:22 AM
  4. win2k dns lookup
    By serrrrrver in forum Tech Board
    Replies: 11
    Last Post: 01-13-2003, 12:50 PM
  5. DNS Lookup
    By xxx in forum Windows Programming
    Replies: 1
    Last Post: 01-08-2003, 02:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21