Skip to content
/ dns_c Public

A toy DNS resolver using C's POSIX socket API

Notifications You must be signed in to change notification settings

zrottman/dns_c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DNS Resolver (in progress)

This collaborative project is a toy DNS resolver written in C and based on Julia Evans' Implement DNS in a Weekend Python guide.

The program features DNSQuery, DNSHeader, DNSQuestion, and DNSRecord structs that maintain the various component parts of a DNS request and the parsed DNS response. At a high level, the program currently performs as follows:

  1. open a socket fild descriptor using socket()
  2. instantiate and populate a DNSQuery struct with details about the DNS request using constructor function NewDNSQuery()
  3. send above DNSQuery struct using sendto()
  4. receive response with recvfrom()
  5. close socket file descriptor with `close()
  6. parse response into DNSHeader, DNSQuestion, and DNSRecord structs

For working branch, see sendto.

Sandbox and Side Projects

The sandbox/ directory contains a number of DNS-related and DNS-adjacent experients and toy projects designed to improve intuition about networking in general and C's networking systems calls.

About

A toy DNS resolver using C's POSIX socket API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published