SmtpGetPtrData Method
Retrieves the list of domain names for the specified IP address.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.3.1 build 666 for .NET 4.5
public string[] GetPtrData(
	string ipString


Type: SystemString
The IP address string.

Return Value

Type: String
The array of strings taken from DNS PTR data for the specified IP address, or a null reference (Nothing in Visual Basic) if an error occurred or no PTR record found for the given domain.
MailBeeInvalidArgumentExceptionipString is a null reference (Nothing in Visual Basic).
MailBeeExceptionAn error occurred and ThrowExceptions is true.

This method makes DNS PTR query (reverse DNS query) to the servers listed in DnsServers collection regarding ipString address.

Popular anti-spam check is making reverse DNS query for the IP address from which the mail message was sent. Then, the retured domain name is compared with the domain name from "From:" or "Return-Path:" address to make sure it was really sent from that domain.

Note Note
If the IP address has multiple domain names associated with it, PTR record will usually return only the domain name taken from A record. Other domain names are aliases (CNAMEs). They will not be returned as their information is not contained in PTR records.
This sample retrieves domain names associated with an IP address. Make sure to specify real IP address prior to running this sample.
using System;
using MailBee;
using MailBee.SmtpMail;

class Sample
    static void Main(string[] args)
        Smtp mailer = new Smtp();
        string[] domains = mailer.GetPtrData("");
        foreach (string domain in domains)
See Also