I'm actually looking for something to see, in the RECEIVED FROM: email header, if domain and IP address match, so to control spam. Thanks for your interest
I have attached a simple example showing how a program can reverse-lookup an IP address and get it corresponding DNS name.
If you do this with the IP address you can compare the result against the DNS Name in the mail header. This can get a little "iffy" though. A host can have many names.
thanks for the tip, very useful!
but now, if I want to do the opposite, to obtain the IP address of a Domain? you have some other examples? thanks again
Forward lookups are trivial. You can do this using the Winsock control, or if you examine the code provided above you will see that it can be done using a subset of the logic in the reverse lookup function.