Click here to Skip to main content
15,917,795 members
Home / Discussions / C#
   

C#

 
GeneralSecure FTP Pin
Robert M Greene27-Apr-05 3:54
Robert M Greene27-Apr-05 3:54 
GeneralRe: Secure FTP Pin
Marc Clifton27-Apr-05 6:05
mvaMarc Clifton27-Apr-05 6:05 
GeneralCreating References in code Pin
metalsandman27-Apr-05 3:18
metalsandman27-Apr-05 3:18 
GeneralRe: Creating References in code Pin
leppie27-Apr-05 3:20
leppie27-Apr-05 3:20 
GeneralCustom dll's in a project and how to hide them Pin
rob_ple27-Apr-05 2:58
rob_ple27-Apr-05 2:58 
GeneralProblems with the StreamReader Pin
Elvir27-Apr-05 2:40
Elvir27-Apr-05 2:40 
GeneralRe: Problems with the StreamReader Pin
rob_ple27-Apr-05 3:11
rob_ple27-Apr-05 3:11 
GeneralMake a DNS query against an open relay database Pin
Stoffe27-Apr-05 2:11
Stoffe27-Apr-05 2:11 
Hello

I'm trying to make a Dns query against ordb.org (a database contaning smtp servers that are classified as open relays).

I know that ordb.org wants the ipaddress for the smtp server with the octets reversed but that's not the problem.

I've been trying to construct a udp packet to send the information to the database but I can't get it right. I don't recieve an answer and i'm unsure if I'm attacking the problem from the right angle so to speak. Below is a rough code example on how I've been trying solve the problem.


/*Send question*/
Socket client = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

byte[] data = Encoding.ASCII.GetBytes(ReversedSMTPIP);

IPAddress addr = Dns.GetHostByName("relays.ordb.org").AddressList[0];

IPEndPoint dest = new IPEndPoint(addr,53);

client.SendTo(data,(EndPoint)dest);

/*Recieve answer*/
byte[] msg = new byte [32*1024];

IPEndPoint iend = new IPEndPoint(IPAddress.Any,0);

EndPoint end = (EndPoint)iend;

int lenght = client.ReceiveFrom(msg,ref end);

string answer = Encoding.ASCII.GetString(msg);


Below is the information from ordb.org FAQ which I'm having trouble understanding correctly.

The simplest way to get started using the ORDB to protect your mail relay against theft of service by spammers, is to arrange for it to make a DNS query agains relays.ordb.org whenever you receive an incoming mail message from a host whose relaying status you do not know.
The theory of operation is simple. Given a host address in its dotted-quad form, reverse the octets and check for the existence of an ``A RR'' at that node under the relays.ordb.org node. So if you get an SMTP session from [192.89.123.5] you would check for the existence of:

5.123.89.192.relays.ordb.org. IN A 127.0.0.2

We chose to use an ``A RR'' because that's what most MTA's can use to filter incoming connections. The choice of [127.0.0.2] as the target address was arbitary but will not change. As it happens, we supply a bogus ORDB entry for [127.0.0.2] so that mail transport developers have something to test against.

I'm on the right track here?
Any help at all would be greatly appriciated.

Best Regards
Kristofer




GeneralRe: Make a DNS query against an open relay database Pin
S. Senthil Kumar27-Apr-05 4:21
S. Senthil Kumar27-Apr-05 4:21 
GeneralRe: Make a DNS query against an open relay database Pin
Stoffe29-Apr-05 7:57
Stoffe29-Apr-05 7:57 
GeneralRegarding Mouse Move event!! Pin
RajeshGuptha27-Apr-05 1:59
RajeshGuptha27-Apr-05 1:59 
GeneralRe: Regarding Mouse Move event!! Pin
MoustafaS27-Apr-05 5:18
MoustafaS27-Apr-05 5:18 
Generalchange keyboard layout Pin
El'Cachubrey27-Apr-05 1:17
El'Cachubrey27-Apr-05 1:17 
Generalserializing in client Pin
balkang27-Apr-05 1:00
balkang27-Apr-05 1:00 
GeneralRe: serializing in client Pin
Judah Gabriel Himango27-Apr-05 7:52
sponsorJudah Gabriel Himango27-Apr-05 7:52 
GeneralRe: serializing in client Pin
balkang27-Apr-05 9:36
balkang27-Apr-05 9:36 
GeneralRe: serializing in client Pin
Judah Gabriel Himango27-Apr-05 9:44
sponsorJudah Gabriel Himango27-Apr-05 9:44 
Generalconvert types Pin
eng.mohamed27-Apr-05 0:40
eng.mohamed27-Apr-05 0:40 
GeneralRe: convert types Pin
Colin Angus Mackay27-Apr-05 0:57
Colin Angus Mackay27-Apr-05 0:57 
GeneralRe: convert types Pin
Marc Clifton27-Apr-05 1:02
mvaMarc Clifton27-Apr-05 1:02 
Generalprint a pdf file from a web app Pin
brian5527-Apr-05 0:07
brian5527-Apr-05 0:07 
GeneralRe: print a pdf file from a web app Pin
Dave Kreskowiak27-Apr-05 1:44
mveDave Kreskowiak27-Apr-05 1:44 
Generalbutton click event Pin
gaby2r26-Apr-05 22:48
gaby2r26-Apr-05 22:48 
GeneralRe: button click event Pin
Polis Pilavas26-Apr-05 23:28
Polis Pilavas26-Apr-05 23:28 
GeneralRe: button click event Pin
Anonymous26-Apr-05 23:43
Anonymous26-Apr-05 23:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.