Linux Kernel Module program to obtain domain name from IP

Hettiarachchige Hasitha Shan hh_shan at live.com
Tue Jul 8 14:23:45 EDT 2014


Thank you for your responses sirs and the advice. My target is to,

1. Intercept SYN packet
2. Obtain the destination IP address
3. Resolve the TLD of that IP
4. then bind each packet to queues depending on the TLD

I will check on nslookup, open DNS client utilities and dns_resolver libraries as you experts suggested :)

Best Regards,
H. Hasitha Shan



Date: Tue, 8 Jul 2014 15:20:16 +0200
Subject: Re: Re: Linux Kernel Module program to obtain domain name from IP
From: kristofer.hallin at gmail.com
To: kristof at sigsegv.be
CC: kernelnewbies at kernelnewbies.org; shhuiw at 163.com; sudipm.mukherjee at gmail.com; hh_shan at live.com

There's a research project called Name Based Sockets where this have been done.
Take a look at: https://www.sics.se/projects/name-based-sockets
If you search for name based sockets on Google you will find a kernel module and user space code doing this.
On 8 Jul 2014 15:07, "Kristof Provost" <kristof at sigsegv.be> wrote:

On 2014-07-08 20:19:09 (+0800), shhuiw <shhuiw at 163.com> wrote:

> DNS loopkup should use UDP packet, and you have to construct UDP request

> based on your captured IP addresses in your module.

DNS can actually use both TCP and UDP.



> And you have to use DNS server fallback lists and time-out control if some DNS

> server cannot work well.



Yeah. Doing DNS lookups (forward or reverse) is complicated.

There's a dns_query function in the kernel (net/dns_resolver), which

apparently upcalls into user space, but I'd avoid dealing with DNS in

the kernel at all.



Just pass the IP address to user space and let it deal with it. There

are plenty of DNS libraries available. Odds are you need to pass the

resulting information to user space anyway, so you're not really losing

anything.



What are you trying to accomplish anyway?



Regards,

Kristof



_______________________________________________

Kernelnewbies mailing list

Kernelnewbies at kernelnewbies.org

http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140708/161231b7/attachment.html 


More information about the Kernelnewbies mailing list