Skip to content

Commit b25af27

Browse files
committed
initial commit
0 parents  commit b25af27

File tree

5 files changed

+97
-0
lines changed

5 files changed

+97
-0
lines changed

Dockerfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM python:2.7.12-alpine
2+
ENV CHININUXPATH /root/chininux
3+
4+
RUN apk --no-cache add dnsmasq
5+
RUN apk --no-cache add git
6+
7+
RUN git clone https://github.com/ninuxorg/chininux $CHININUXPATH
8+
RUN cd $CHININUXPATH; git submodule init; git submodule update
9+
RUN pip install -r $CHININUXPATH/requirements.txt
10+
COPY settings.py $CHININUXPATH/
11+
12+
COPY dnsmasq.conf /etc/dnsmasq.conf
13+
# the contents of this directory are read automatically by dnsmasq
14+
RUN mkdir -p /etc/chosts
15+
16+
# put the script in the crontab
17+
COPY chininuxhostscript /etc/periodic/hourly/chininuxhostscript
18+
RUN chmod +x /etc/periodic/hourly/chininuxhostscript
19+
# and run it once
20+
RUN /etc/periodic/hourly/chininuxhostscript
21+
22+
EXPOSE 53/udp 53/udp
23+
24+
ENTRYPOINT ["dnsmasq", "-d", "--hostsdir=/etc/chosts/", "-C", "/etc/dnsmasq.conf"]
25+

README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
DNS basato su chininux
2+
======================
3+
Container docker per DNS basato su (chininux)[https://github.com/ninuxorg/chininux].
4+
Scarica le associazioni tra indirizzi IP (ninux)[http://wiki.ninux.org] e nomi dall'API di (nodeshot)[https://github.com/ninuxorg/nodeshot] periodicamente.
5+
Permette di fare lookup e reverse lookup sugli indirizzi IP ninux.
6+
7+
8+
English: chinux-based DNS
9+
-------------------------
10+
11+
(chininux)[https://github.com/ninuxorg/chininux] based DNS docker container.
12+
It retrieves the association between (ninux)[http://wiki.ninux.org] IP addressess and names from the (nodeshot)[https://github.com/ninuxorg/nodeshot] API periodically.
13+
It allows to perform lookups and reverse lookups on the ninux IP addresses.
14+
15+
16+
Installazione
17+
-------------
18+
19+
clonare o scaricare questo repository
20+
21+
fare il build dell'immagine docker
22+
```
23+
cd chininuxdns-docker
24+
docker build --tag chininuxdns .
25+
```
26+
27+
lanciare il container docker
28+
```
29+
docker run -d -p 53:53/udp chininuxdns
30+
```
31+
32+
33+
Test
34+
----
35+
36+
reverse lookup di un indirizzo ninux
37+
```
38+
dig @127.0.0.1 -x 172.16.176.1
39+
```
40+
41+
lookup di un indirizzo Internet
42+
```
43+
dig @127.0.0.1 wiki.ninux.org
44+
```
45+

chininuxhostscript

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
CHININUXPATH="/root/chininux/"
4+
HOSTSDIR="/etc/chosts/"
5+
6+
#TODO sleep some random time
7+
8+
cd $CHININUXPATH
9+
export PYTHONPATH="${CHININUXPATH}:${PYTHONPATH}"
10+
python ${CHININUXPATH}/chininuxhosts > ${HOSTSDIR}/current
11+
12+
#TODO check actual output of the above command
13+

dnsmasq.conf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#log-queries
2+
3+
# Do NOT read resolv.conf.
4+
no-resolv
5+
6+
# use OpenDNS as default upstream nameserver
7+
server=208.67.222.222
8+
server=208.67.220.220
9+
10+

settings.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# chininux settings
2+
3+
GIURLS = [ "nodeshot://ninux.nodeshot.org" ]
4+

0 commit comments

Comments
 (0)