项目作者: merrychap

项目描述 :
:anchor: Implementation of a caching DNS server. All operations are correspond to RFC 1035
高级语言: Python
项目地址: git://github.com/merrychap/dns-cache.git
创建时间: 2017-08-27T13:35:44Z
项目社区:https://github.com/merrychap/dns-cache

开源协议:MIT License

下载


Implementation of a caching DNS Server

General description

This is an implementation of a UDP caching DNS server written in Python3.
All written operations are correspond to RFC 1035

Requirements

  • Python 3.*
  • IPy

Usage

To run a server use the next command:

  1. $ python3 dns.py [-h] [-p P] [-f F]

List of arguments:

Argument Description
-h, —help Show this help message and exit
-p P Port for running a server
-f F Address of a forwarder written in format IP:Port. Port can be omitted

For example, you run a server on 9090 port. Then you can make queries to it by typing the next command (get A records from google.com):

  1. dig +notcp @127.0.0.1 -p 9090 google.com A

Example of using

  1. $ python3 dns.py -p 9090 -f 8.8.8.8
  2. [+] Server is configurated
  3. [+] Server is running on 9090 port
  4. 2017-05-09 20:14:50 -- [*] 127.0.0.1 A google.com. forwader
  5. 2017-05-09 20:14:51 -- [*] 127.0.0.1 A google.com. cache
  6. 2017-05-09 20:14:52 -- [*] 127.0.0.1 A google.com. cache
  7. 2017-05-09 20:14:52 -- [*] 127.0.0.1 A google.com. cache
  8. 2017-05-09 20:14:52 -- [*] 127.0.0.1 A google.com. cache
  9. 2017-05-09 20:14:53 -- [*] 127.0.0.1 A google.com. cache
  10. 2017-05-09 20:14:53 -- [*] 127.0.0.1 A google.com. cache
  11. 2017-05-09 20:14:54 -- [*] 127.0.0.1 A google.com. cache
  12. 2017-05-09 20:15:02 -- [*] 127.0.0.1 A ya.ru. forwader
  13. 2017-05-09 20:15:03 -- [*] 127.0.0.1 A ya.ru. cache
  14. 2017-05-09 20:15:05 -- [*] 127.0.0.1 NS ya.ru. forwader
  15. 2017-05-09 20:15:06 -- [*] 127.0.0.1 NS ya.ru. cache