[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DNS A record resolution pseudo-code



Hi all,

I have mocked up some basic experiments with Mirage and UDP packets and
DNS packets. However, now it's time to roll up my sleeves and think about
the structure of the pseudo-code, and what I'd like to eventually commit
to the project. I think better with a group, out loud as it were so I hope
you don't mind my leaving this here:

Initialise PRNG
Generate Random Port #
Query Input (initially command line later as args to function)
Start UDP Listener on Random Port
Start Timeout Clock
Determine NSServer to query (Initially hardcoded but later a list from
config)
Generate Random Packet ID # and store for reference later
Construct Query for A record
Send DNSPacket to NSServer port 453
If arrive before timeout
    Parse the reply or report parsing error
    If good Id #
        Report resolved name or handle data dependant errors
    Else bad id #
        Report potential spoofery
else timed out
    Report no results due to timeout
Close UDP Listener

Please ask questions and make suggestions/revisions...

Eireann




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.