Code Monkey home page Code Monkey logo

fun-dns's Introduction

 _____   __   _   _____     _____   _____   _____      _____   _   _   __   _  
|  _  \ |  \ | | /  ___/   |  ___| /  _  \ |  _  \    |  ___| | | | | |  \ | | 
| | | | |   \| | | |___    | |__   | | | | | |_| |    | |__   | | | | |   \| | 
| | | | | |\   | \___  \   |  __|  | | | | |  _  /    |  __|  | | | | | |\   | 
| |_| | | | \  |  ___| |   | |     | |_| | | | \ \    | |     | |_| | | | \  | 
|_____/ |_|  \_| /_____/   |_|     \_____/ |_|  \_\   |_|     \_____/ |_|  \_| 
                                                                version 0.1.12

Fun DNS server  build on top of Nodejs

How install
	Run $ sudo setup.sh
OR
	$ wget -O /tmp/fun_dns.tar.gz https://github.com/downloads/badlee/fun-dns/fun_dns.v0.1.12.tar.gz
	$ sudo -s 
	$ mkdir /opt/fun_dns
	$ cd /opt/fun_dns
	$ tar xvf /tmp/fun_dns.tar.gz
	$ ln -s /opt/fun_dns/fun_dns.daemon /etc/init.d/fun_dns
	$ update-rc.d fun_dns defaults
	$ #Start service
	$ service fun_dns start

How define hostname
	edit 'config/conf.json',
	the syntaxe of this file respect json format
		{
			"hostname1" : {
				[property...]
			},
			"hostname2" : {
				[property...]
			},
			"hostname3" : {
				[property...]
			},
			[...]
			"hostnameN" : {
				[property...]
			}
		}
	properties of a hostname
		"name" : {
			"ip" : "127.0.0.1",
			"description" : "je suis le serveur web local",
			"autority" : "dns.{name},admin@{name}",
			"mail" : {
				"ip" : "127.0.0.2",
				"name" : "mail.{name}",
				"priority" : 10
			},
			"nameserver" : [{
				"ip" : "127.0.0.1",
				"name" : "ns1.{name}"
			}]
		}
	The hostname can have a short regex like syntaxe.
		*  : this expression respect ".*" in regex;
		%w : this expression respect "[a-zA-Z0-9_]+" in regex;
		%h : this expression respect "[a-fA-F0-9]+" in regex;
		%d : this expression respect "[0-9]+" in regex;

	sample conf.json :
		{
			"server.web" : {
				"ip" : "192.168.1.3",
				"nameserver" : [{
					"name" : "dns3.local.web"
				},{
					"ip" : "192.168.1.2",
					"name" : "dns2.local.web"
				},{
					"ip" : "192.168.1.1",
					"name" : "dns.local.web"
				}]
			},
			"!*.lo" : {
				"ip" : "127.0.0.1",
				"autority" : "dns.{name},admin@{name}",
		
				"nameserver" : [{
					"ip" : "127.0.0.1",
					"name" : "dns.{name}"
				},{
					"ip" : "127.0.0.1",
					"name" : "dns2.{name}"
				}]
		
			}
		}

Server confiurations(config/serv.ini)
	conf = configuration hostname file(if not defined is set to app://config/conf.json)
	host = your ip4 addresse to listen(if not defined listen all)
	port = port to listen(if not defined listen 53)
	Section nameserver = list of dns server used to found response when no response found on server(as a proxy, but it's eprouve the global performances)
	[nameserver] 
		nameOfTheDnsServer1 = Ip_Address
		nameOfTheDnsServer2 = Ip_Address
		...
		nameOfTheDnsServer3 = Ip_Address
	Section ttl = list of ttl in dns reponse (in secondes)
	[ttl]
		ip  = ttl for any ip (A or AAAA) address (if not defined 77)
		ttl = ttl for any field different of ip (A or AAAA) (if not defined 600)
		refresh = time to refresh the zone (if not defined 1800)
		retry   = time to retry when refresh (above) has expired (if not defined 900)
		expiration = ttl for DNS response (if not defined 604800)

	sample serv.ini:
		conf = app://config/lab.json
		port = 53
		host = 192.168.1.1
		spf  = "v=spf1 +all"
		[ttl]
		    ttl = 600
		    ip  = 77
		[nameserver]
		    google.dns.a = 8.8.8.8
		    google.dns.b = 8.8.4.4



Command line option
	Usage:
		fun_dns [options]
	Options:
	---	-p|--port <value>  
			port to listen.
	---	-h|--host <value>  
			host to bind.
	---	-c|--conf <value>  
			configuration file(hostname).
	---	-s|--servConf <value>
			configuration file(server).
	---	-v|--version       
			Get the version of fun_dns
	---	-z|--zone <value>  
			Lookup a zoneWalk
	---	-l|--log <value>  
			path to log file

fun-dns's People

Contributors

badlee avatar codetrol avatar oshimin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fun-dns's Issues

License ?

I didn't see any LICENSE file with this. Are there any copyright restrictions if I want to use parts of it in my projects?

fun-dns proxy gives incorrect result

Hi! I like fun-dns and I would like to use it as replacement to BIND9 for my home network. Why? Because BIND's recursion feature stopped working unexpectedly (even re-installation doesn't solve it), so I use fun-dns. I set up conf.json and serv.ini. However, when fun-dns uses proxy records come different from original. Let me show you by example:
nslookup google.com

# original (ISP's dns response)#
Non-authoritative answer:
Name:   google.com
Address: 173.194.39.129
Name:   google.com
Address: 173.194.39.130
Name:   google.com
Address: 173.194.39.131
Name:   google.com
Address: 173.194.39.132
Name:   google.com
Address: 173.194.39.133
Name:   google.com
Address: 173.194.39.134
Name:   google.com
Address: 173.194.39.135
Name:   google.com
Address: 173.194.39.136
Name:   google.com
Address: 173.194.39.137
Name:   google.com
Address: 173.194.39.142
Name:   google.com
Address: 173.194.39.128
# fun-dns response (using proxy) #
Name:   google.com
Address: 173.39.128.128
Name:   google.com
Address: 173.39.129.129
Name:   google.com
Address: 173.39.130.130
Name:   google.com
Address: 173.39.131.131
Name:   google.com
Address: 173.39.132.132
Name:   google.com
Address: 173.39.133.133
Name:   google.com
Address: 173.39.134.134
Name:   google.com
Address: 173.39.135.135
Name:   google.com
Address: 173.39.136.136
Name:   google.com
Address: 173.39.137.137
Name:   google.com
Address: 173.39.142.142

As you can see, numbers (a,b,c,d) in fun-dns shown like (a,c,d,d)

NPM module

Is there an NPM module for this? If not, could you create one please?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.