https://doc.infosec.unamur.be/api.php?action=feedcontributions&user=Rpich&feedformat=atomUNamur InfoSec - User contributions [en]2024-03-29T14:47:20ZUser contributionsMediaWiki 1.39.4https://doc.infosec.unamur.be/index.php?title=Testbed_of_DNS_Installation_and_Deployment_In_Real_Environment&diff=1014Testbed of DNS Installation and Deployment In Real Environment2021-11-19T13:08:39Z<p>Rpich: Created page with " == Testbed DNS Installation == === <p>System Infrastructure and Installation</p>=== <p>Our testbed has been implemented to see the process of DNS flow. The blue shapes of ''..."</p>
<hr />
<div><br />
== Testbed DNS Installation ==<br />
<br />
===<br />
<p>System Infrastructure and Installation</p>===<br />
<p>Our testbed has been implemented to see the process of DNS flow. The blue shapes of '''figure.1''' are the local servers that have been installed such as Name Server and its sub-Name Server, Resolver Server, Web Server.</p></li></ol><br />
<br />
<br />
<li><p>Registered Domain</p></li></ol><br />
<br />
<ul><br />
<li><p>bekhinfosec.be have been pointed to two name servers:</p><br />
<ul><br />
<li><p>ns1.infosec.unamur.be (stands as parent zone and child zone which resolves sub-domain is ns2.bekhinfosec.be)</p><br />
<p>ns1.infosec.unamur.be : 138.48.246.201</p><br />
<p>ns2.bekhinfosec.be : 138.48.246.202</p></li><br />
<li><p>ns2.infosec.umamur.be (not installed)</p><br />
<br />
</li></ul><br />
<br />
[[File:1.png|thumb]]<br />
<br />
Figure 1. Testbed Architecture<br />
<br />
<br />
<ol style="list-style-type: lower-alpha;"><br />
<li><p>Servers Installation</p></li></ol><br />
<br />
<ul><br />
<li><p>'''Name Sever Installation and Configuration'''<br /><br />
We use Ubuntu Server version 20.04 as Operating System and in order to make name server we use bind9 and the process of installation as below:</p><br />
<ul><br />
<li><p>Update system and Package Installation</p><br />
<p>'''''Sudo apt-get update'''''</p><br />
<p>'''''Sudo apt-get install bind9 dnsutils'''''</p></li><br />
<li><p>Zone Configuration file and Zone file</p><br />
<p>In the location of '''/etc/bind'''</p><br />
<p>'''''Sudo nano named.conf.local '''''</p><br />
<p>For example: ns1.infosec.unamur.be : 138.48.246.201</p><br />
<p>'''''zone &quot;bekhinfosec.be&quot; IN {'''''</p><br />
<p>'''''type master;'''''</p><br />
<p>'''''file &quot;/var/lib/bind/db.bekhinfosec.be&quot;;'''''</p><br />
<p>'''''};'''''</p><br />
<p>'''''zone &quot;246.48.138.in-addr.arpa&quot; IN {'''''</p><br />
<p>'''''type master;'''''</p><br />
<p>'''''file &quot;/var/lib/bind/db.246.48.138.in-addr.arpa&quot;;'''''</p><br />
<p>'''''};'''''</p><br />
<p>That we store the zone file and its reverse file in the location of '''/var/lib/bind'''</p><br />
<p>File: ''db.bekhinfosec.be''</p><br />
<p>'''''$TTL 1H'''''</p><br />
<p>'''''@ IN SOA @ hostmaster.bekhinfosec.be. ('''''</p><br />
<p>'''''0 ; serial'''''</p><br />
<p>'''''1H ; refresh'''''</p><br />
<p>'''''1H ; retry'''''</p><br />
<p>'''''1W ; expire'''''</p><br />
<p>'''''1H ) ;minimum'''''</p><br />
<p>'''''@ IN NS ns1.infosec.unamur.be.'''''</p><br />
<p>'''''ns1 IN A 138.48.246.201'''''</p><br />
<p>'''''www IN NS ns2.bekhinfosec.be.'''''</p><br />
<p>'''''ns2 IN A 138.48.246.202'''''</p><br />
<p>'''''host1 IN A 138.48.246.203 ;'''''</p><br />
<p>Reverse zone file: ''db.246.48.138.in-addr.arpa''</p><br />
<p>'''''$TTL 1H'''''</p><br />
<p>'''''@ IN SOA @ hostmaster.bekhinfosec.be. ('''''</p><br />
<p>'''''0 ; serial'''''</p><br />
<p>'''''1H ; refresh'''''</p><br />
<p>'''''1H ; retry'''''</p><br />
<p>'''''1W ; expire'''''</p><br />
<p>'''''1H ) ;minimum'''''</p><br />
<p>'''''@ IN NS ns1.infosec.unamur.be.'''''</p><br />
<p>'''''ns1 IN A 138.48.246.201'''''</p><br />
<p>'''''www IN NS ns2.bekhinfosec.be.'''''</p><br />
<p>'''''ns2 IN A 138.48.246.202'''''</p><br />
<p>'''''host1 IN A 138.48.246.203'''''</p><br />
<p>'''''201 IN PTR ns1.infosec.unamur.be.'''''</p><br />
<p>'''''202 IN PTR ns2.bekhinfosec.be.'''''</p><br />
<p>'''''203 IN PTR host1.bekhinfosec.be.'''''</p><br />
<p>For the sub name server the process, installation and configuration is the same as parent zone. For named.conf.local in this installation it is put the same name and location. And for the zone file is like below:</p><br />
<p>File: ''db.bekhinfosec.be''</p><br />
<p>'''''$TTL 604800'''''</p><br />
<p>'''''@ IN SOA @ hostmaster.bekhinfosec.be. ('''''</p><br />
<p>'''''2 ; Serial'''''</p><br />
<p>'''''604800 ; Refresh'''''</p><br />
<p>'''''86400 ; Retry'''''</p><br />
<p>'''''2419200 ; Expire'''''</p><br />
<p>'''''604800 ) ; Negative Cache TTL'''''</p><br />
<p>''''';'''''</p><br />
<p>'''''@ IN NS ns2.bekhinfosec.be.'''''</p><br />
<p>'''''ns2 IN A 138.48.246.202'''''</p><br />
<p>'''''www IN A 138.48.246.205'''''</p><br />
<p>Reverse zone file: ''db.246.48.138.in-addr.arpa''</p><br />
<p>'''''$TTL 604800'''''</p><br />
<p>'''''@ IN SOA @ hostmaster.bekhinfosec.be. ('''''</p><br />
<p>'''''2 ; Serial'''''</p><br />
<p>'''''604800 ; Refresh'''''</p><br />
<p>'''''86400 ; Retry'''''</p><br />
<p>'''''2419200 ; Expire'''''</p><br />
<p>'''''604800 ) ; Negative Cache TTL'''''</p><br />
<p>''''';'''''</p><br />
<p>'''''@ IN NS ns2.bekhinfosec.be.'''''</p><br />
<p>'''''ns2 IN A 138.48.246.202'''''</p><br />
<p>'''''www IN A 138.48.246.205'''''</p><br />
<p>'''''202 IN PTR ns2.bekhinfosec.be.'''''</p><br />
<p>'''''205 IN PTR www.bekhinfosec.be.'''''</p><br />
<p>Below is the most common used syntax for our installation and configuration</p><br />
<p># Check syntax and zone in configuration and restart service:</p><br />
<p>'''''Sudo named-checkconf'''''</p><br />
<p>'''''sudo named-checkzone bekhinfosec.be db.bekhinfosec.be'''''</p><br />
<p>'''''sudo named-checkzone 246.48.138.in-addr.arpa db.246.48.138.in-addr.arpasudo service bind9 restart'''''</p><br />
<p>'''''sudo service bind9 status'''''</p></li></ul><br />
</li><br />
<li><p>'''Resolver Installation and Configuration '''</p></li></ul><br />
<br />
<blockquote>To install resolver server there are many open-source can be used, but in this testbed, we have used unbound package to implement our local resolver.<br />
</blockquote><br />
<ul><br />
<li><p>Update system and Package Installation</p><br />
<p>'''''Sudo apt-get update'''''</p><br />
<p>'''''Sudo apt-get install unbound'''''</p></li><br />
<li><p>Configuration file in the location /etc/unbound/</p><br />
<p>'''''Sudo nano unbound.conf '''''</p><br />
<p>For example: our resolver: 138.48.246.204</p><br />
<p>'''''server:'''''</p><br />
<p>'''''directory: &quot;/etc/unbound&quot;'''''</p><br />
<p>'''''username: infosec'''''</p><br />
<p>'''''interface: 138.48.246.204'''''</p><br />
<p>'''''interface: ::0'''''</p><br />
<p>'''''access-control: 138.48.246.0/24 allow'''''</p><br />
<p>'''''access-control: 172.0.0.1 allow'''''</p><br />
<p>'''''access-control: ::1 allow'''''</p><br />
<p>'''''access-control: 0.0.0.0/0 deny'''''</p><br />
<p>'''''access-control: ::/0 deny'''''</p><br />
<p>'''''# In case you want to limit the ttl of cache of your resolver '''''</p><br />
<p>'''''# cache-max-ttl: 30 '''''</p><br />
<p>'''''# cache-min-ttl: 0'''''</p><br />
<p>'''''serve-expired: no'''''</p><br />
<p>'''''# In case you want to base on other public resolver (google) '''''</p><br />
<p>'''''#forward-zone: '''''</p><br />
<p>'''''# name: &quot;.&quot;'''''</p><br />
<p>'''''# forward-addr: 4.2.2.2'''''</p><br />
<p>'''''# forward-addr: 4.2.2.1'''''</p><br />
<p>'''''# forward-first: yes'''''</p></li><br />
<li><p>Restart and service check up</p></li></ul><br />
<br />
'''''sudo systemctl restart unbound.service'''''<br />
<br />
'''''sudo systemctl status unbound.service'''''<br />
<br />
* '''Web Server installation '''<br />
<br />
<blockquote>To resolver the name of one machine, we have made web hosting to represent that machine. We used nginx as web server.<br />
</blockquote><br />
<ul><br />
<li><p>Update system and Package Installation</p><br />
<p>'''''Sudo apt-get update'''''</p><br />
<p>'''''Sudo apt-get install nginx'''''</p></li><br />
<li><p>Create project folder and file in the location /var/www/'''bekhinfosec.be/index.html'''</p><br />
<p>'''''&lt;!DOCTYPE html&gt;'''''</p><br />
<p>'''''&lt;html&gt;'''''</p><br />
<p>'''''&lt;head&gt;'''''</p><br />
<p>'''''&lt;style&gt;'''''</p><br />
<p>'''''title {text-align: center;}'''''</p><br />
<p>'''''h1 {text-align: center;}'''''</p><br />
<p>'''''&lt;/style&gt;'''''</p><br />
<p>'''''&lt;title&gt; Welcome to My Page&lt;/title&gt;'''''</p><br />
<p>'''''&lt;/head&gt;'''''</p><br />
<p>'''''&lt;body&gt;'''''</p><br />
<p>'''''&lt;h1&gt; Here is my Testbet Page&lt;/h1&gt;'''''</p><br />
<p>'''''&lt;p&gt; Welcome to my pages and this page is for testing only&lt;/p&gt;'''''</p><br />
<p>'''''&lt;/body&gt;'''''</p><br />
<p>'''''&lt;/html&gt;'''''</p></li><br />
<li><p>File configuration (site) in a location /etc/nginx/sites-available/bekhinfosec.be</p><br />
<p>'''''server {'''''</p><br />
<p>'''''listen 80 default_server;'''''</p><br />
<p>'''''listen [::]:80 default_server;'''''</p><br />
<p>'''''root /var/www/bekhinfosec.be;'''''</p><br />
<p>'''''index index.html;'''''</p><br />
<p>'''''server_name bekhinfosec.be www.bekhinfosec.be;'''''</p><br />
<p>'''''location / {'''''</p><br />
<p>'''''try_files $uri $uri/ =404;'''''</p><br />
<p>'''''}'''''</p><br />
<p>'''''}'''''</p><br />
<p>Then we have to create a hard link for other directory is sites-enabled</p><br />
<p>'''''sudo ln -s /etc/nginx/sites-available/bekhinfosec.be /etc/nginx/sites-enabled/bekhinfosec.be'''''</p><br />
<p>finally, we have to restart nginx</p><br />
<p>'''''sudo systemctl restart nginx'''''</p><br />
<p>To check error of your configuration you can use:</p><br />
<p>'''''Sudo nginx -t '''''</p></li></ul><br />
<br />
* '''Client machine configuration '''<br />
<br />
<blockquote>For client machine we just need to assign the resolver and name to resolv.conf file so we can test our connection. In the location of /etc/resolv.conf<br />
<br />
'''''Sudo nano /etc/resolv.conf'''''<br />
<br />
'''''Search bekhinfosec.be'''''<br />
<br />
'''''Nameserver 138.48.246.204'''''<br />
</blockquote><br />
# '''Traffic Capturing '''<br />
<br />
<blockquote>As we installed our system in Proxmox as VM so to capture traffic we can use tcpdump or you can install wireshark to capture the data<br />
</blockquote><br />
<ol style="list-style-type: lower-alpha;"><br />
<li><p>Wireshark Installation</p><br />
<p>'''''Sudo apt-get update'''''</p><br />
<p>'''''Sudo apt-get upgrade'''''</p><br />
<p>'''''Sudo apt-get install wireshark '''''</p><br />
<p>[[File:media/image2.png|594x84px]]</p></li></ol><br />
<br />
<blockquote>For this process we don’t see the whole connection from client to Name Server because we have tested it and the data have been cached in the resolver: 138.48.246.204. But if you see like this it means that your testbed has been working well. For example you can test with: [http://www.bekhinfosec.be www.bekhinfosec.be] you will see the result of testing page (index.html):<br />
<br />
[[File:media/image3.png|532x80px]]<br />
<br />
[[File:media/image4.png|449x486px]]We can use tcpdump and save in pcap file then it can be opened with wireshark.<br />
<br />
'''''Sudo tcpdump -in vmbr0 port 53 -w testing.pcap'''''<br />
<br />
Vmbr0 is the vitual interface of my network in proxmox and we capture only dns traffic (port 53)<br />
</blockquote></div>Rpichhttps://doc.infosec.unamur.be/index.php?title=File:1.png&diff=1013File:1.png2021-11-19T11:59:37Z<p>Rpich: </p>
<hr />
<div>DNStraffic</div>Rpichhttps://doc.infosec.unamur.be/index.php?title=DNS&diff=1012DNS2021-11-19T11:51:25Z<p>Rpich: </p>
<hr />
<div>[[Install DNS in raspberry pi]]<br />
<br />
[[Testbed of DNS Installation and Deployment In Real Environment ]]</div>Rpichhttps://doc.infosec.unamur.be/index.php?title=DNS&diff=1011DNS2021-11-19T11:51:15Z<p>Rpich: </p>
<hr />
<div>[[Install DNS in raspberry pi]]<br />
[[Testbed of DNS Installation and Deployment In Real Environment ]]</div>Rpichhttps://doc.infosec.unamur.be/index.php?title=DNS&diff=1010DNS2021-11-19T11:46:36Z<p>Rpich: </p>
<hr />
<div>[[Install DNS in raspberry pi]]</div>Rpichhttps://doc.infosec.unamur.be/index.php?title=Install_DNS_in_raspberry_pi&diff=1009Install DNS in raspberry pi2021-11-19T11:45:35Z<p>Rpich: /* Local DNS Installation Procedure Using Raspberry Pi */</p>
<hr />
<div>==Local DNS Installation Procedure Using Raspberry Pi==<br />
<br />
=== Requirement and Devices ===<br />
# Devices check-list <br />
#* Two Raspberry Pi (server, client) + 16GB SD Card <br />
#* Networking devices: switch, network Cable, Router , Keyboard and Mouse. <br />
# Technology<br />
#* Raspberry Pi Ubuntu Server Operating System<br />
#**Reference: https://ubuntu.com/download/raspberry-pi<br />
#*Raspberry Pi Imager<br />
#**Reference: https://www.raspberrypi.org/software/<br />
#**Putty for remote ssh to our Raspberry Pi<br />
#**Reference: https://www.putty.org/<br />
#System Physical Architecture<br />
[[Image:abc.png|thump|Architecture]]<br />
===Installation Process===<br />
====We assume that: ====<br />
* Both Raspberry Pi have been installed ubuntu server operating system<br />
* Our local network has been connected to internet and local network with LAN: 192.168.0.1/24 (gateway: 192.168.0.1)<br />
=====DNS Server:===== <br />
* Hostname: server.inforsec.com<br />
* IP address: 192.168.0.2<br />
=====DNS Client:=====<br />
* Hostname: client.infosec.com<br />
* IP address: 192.168.0.3<br />
=====DNS Package Installation=====<br />
we use bind9 package for our DNS server and dnsutils for troubleshooting tool<br />
* <b>sudo apt install bind9 dnsutils</b><br />
=====DNS File Configuration=====<br />
After we installed the packaged in our DNS server, we will get the configuration folder in /etc/bind/<br />
* /etc/bind/named.conf.options: global DNS options<br />
* /etc/bind/named.conf.local: for your zones<br />
* /etc/bind/named.conf.default-zones: default zones such as localhost, its reverse, and the root hints<br />
First of all we have to configure our zones so we have domain zone and IP zone (forward zone and reverse zone) <br />
* <b>Sudo nano /etc/bind/named.conf.local</b><br />
then we add the configuration of both zones into file <br />
<br />
Note:for indenting we can’t use tab button, we have to use space button<br />
<br />
Forward zone and Reverse zone:<br />
<div style="border : 2px solid gray "> <br />
<br />
zone "infosec.com" IN {<br />
type master;<br />
file "/etc/bind/db.infosec.com";<br />
};<br />
//db.infosec.com it is just the name so we can put anything we want <br />
<br />
zone "0.168.192.in-addr.arpa" IN {<br />
type master;<br />
file "/etc/bind/db.192";<br />
};<br />
//the same case that db.192 it is just the name so we can but anything we want <br />
</div><br />
Secondly, we have to configure file of each zones (forward and reverse zone) <br />
Forward zone: db.infosec.com<br />
<pre> The configuration template have been made similar to the db.local so we can copy that file to be our file (db.infosec.com) and db.192 is the same structure too.</pre> <br />
* <b>Sudo cp /etc/bind/db.local /etc/bind/db.infosec.com </b><br />
* <b> Sudo nano /etc/bind/db.infosec.com</b><br />
<div style="border : 2px solid gray "><br />
; BIND data file for local loopback interface<br />
:: $TTL 604800<br />
:: @ IN SOA server.infosec.com. root.server.infosec.com. (<br />
2 ; Serial<br />
604800 ; Refresh<br />
86400 ; Retry<br />
2419200 ; Expire<br />
604800 ) ; Negative Cache TTL<br />
;<br />
<br />
::@ IN NS server.infosec.com.<br />
<br />
::@ IN A 192.168.0.2<br />
<br />
::server IN A 192.168.0.2<br />
<br />
::host IN A 192.168.0.2<br />
<br />
::client IN A 192.168.0.3<br />
<br />
::client1 IN A 192.168.0.3<br />
<br />
; server and host is the name that we set for machine 192.168.0.2 (DNS Server) <br />
<br />
; client and client1 are the name that we set for machine 192.168.0.3<br />
<br />
</div><br />
<br />
* <b> Sudo cp /etc/bind/db.infosec.com /etc/bind/db.192 </b><br />
* <b> Sudo nano /etc/bind/db.192 </b><br />
<br />
<div style="border : 2px solid gray "><br />
<br />
; BIND data file for local loopback interface<br />
<br />
:: $TTL 604800<br />
<br />
:: @ IN SOA server.infosec.com. root.server.infosec.com. (<br />
2 ; Serial<br />
604800 ; Refresh<br />
86400 ; Retry<br />
2419200 ; Expire<br />
604800 ) ; Negative Cache TTL<br />
;<br />
::@ IN NS server.infosec.com.<br />
::@ IN PTR infosec.com<br />
::server IN A 192.168.0.2<br />
::host IN A 192.168.0.2<br />
::client IN A 192.168.0.3<br />
::client1 IN A 192.168.0.3<br />
::2 IN PTR server.infosec.com<br />
::3 IN PTR client.infosec.com<br />
</div><br />
<br />
Thirdly, we have to configure our network address and resolv.conf file<br />
<br />
To configure the network interface as we use version 20.0 so it is configured by netplan. <br />
* <b> Sudo nano /etc/netplan/file_name </b><br />
<br />
File_name it is already created so we can go to that location we will get it. The apply this configuration<br />
<br />
<div style="border : 2px solid gray "><br />
<pre><br />
network:<br />
ethernets:<br />
eth0:<br />
dhcp4: no<br />
addresses: [192.168.0.2/24]<br />
gateway4: 192.168.0.1<br />
nameservers:<br />
search: [infosec.com]<br />
addresses: [192.168.0.2]<br />
<br />
</pre><br />
</div><br />
<br />
Then we have to write this command to apply the configuration<br />
* <b>Sudo netplan apply </b><br />
Finally, we have to configure resolv.conf<br />
* <b>Sudo nano /etc/resolv.conf</b><br />
<br />
<div style="border : 2px solid gray "><br />
Nameserver 192.168.0.2<br />
Search infosec.com <br />
</div><br />
For client side we use configure network address like the interface above but with different IP address and set resolv.conf the same as DNS server. <br />
<br />
=== Testing ===<br />
<pre><br />
To test if our configuration is correct or not, we can use ping and nslookup.<br />
- If you use ping it will respond, even you use IP or name of server. <br />
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.<br />
64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.104 ms<br />
64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.093 ms<br />
64 bytes from 192.168.0.2: icmp_seq=3 ttl=64 time=0.069 ms<br />
- Using ping with name<br />
PING server.reatrey.com (192.168.0.2) 56(84) bytes of data.<br />
64 bytes from server.reatrey.com (192.168.0.2): icmp_seq=1 ttl=64 time=0.060 ms<br />
64 bytes from server.reatrey.com (192.168.0.2): icmp_seq=2 ttl=64 time=0.083 ms<br />
64 bytes from server.reatrey.com (192.168.0.2): icmp_seq=3 ttl=64 time=0.070 ms<br />
<br />
</pre><br />
<h1 > Hope You Can Make It Works As I did </h1></div>Rpichhttps://doc.infosec.unamur.be/index.php?title=Install_DNS_in_raspberry_pi&diff=1008Install DNS in raspberry pi2021-11-19T11:38:11Z<p>Rpich: /* Local DNS Installation Procedure Using Raspberry Pi */</p>
<hr />
<div>==Local DNS Installation Procedure Using Raspberry Pi==<br />
<br />
=== Requirement and Devices ===<br />
# Devices check-list <br />
#* Two Raspberry Pi (server, client) + 16GB SD Card <br />
#* Networking devices: switch, network Cable, Router , Keyboard and Mouse. <br />
# Technology<br />
#* Raspberry Pi Ubuntu Server Operating System<br />
#**Reference: https://ubuntu.com/download/raspberry-pi<br />
#*Raspberry Pi Imager<br />
#**Reference: https://www.raspberrypi.org/software/<br />
#**Putty for remote ssh to our Raspberry Pi<br />
#**Reference: https://www.putty.org/<br />
#System Physical Architecture<br />
[[Image:abc.png|thump|Architecture]]<br />
===Installation Process===<br />
====We assume that: ====<br />
* Both Raspberry Pi have been installed ubuntu server operating system<br />
* Our local network has been connected to internet and local network with LAN: 192.168.0.1/24 (gateway: 192.168.0.1)<br />
=====DNS Server:===== <br />
* Hostname: server.inforsec.com<br />
* IP address: 192.168.0.2<br />
=====DNS Client:=====<br />
* Hostname: client.infosec.com<br />
* IP address: 192.168.0.3<br />
=====DNS Package Installation=====<br />
we use bind9 package for our DNS server and dnsutils for troubleshooting tool<br />
* sudo apt install bind9 dnsutils<br />
=====DNS File Configuration=====<br />
After we installed the packaged in our DNS server, we will get the configuration folder in /etc/bind/<br />
* /etc/bind/named.conf.options: global DNS options<br />
* /etc/bind/named.conf.local: for your zones<br />
* /etc/bind/named.conf.default-zones: default zones such as localhost, its reverse, and the root hints<br />
First of all we have to configure our zones so we have domain zone and IP zone (forward zone and reverse zone) <br />
* Sudo nano /etc/bind/named.conf.local<br />
then we add the configuration of both zones into file <br />
<br />
Note:for indenting we can’t use tab button, we have to use space button<br />
<br />
Forward zone and Reverse zone:<br />
<div style="border : 2px solid gray "> <br />
<br />
zone "infosec.com" IN {<br />
type master;<br />
file "/etc/bind/db.infosec.com";<br />
};<br />
//db.infosec.com it is just the name so we can put anything we want <br />
<br />
zone "0.168.192.in-addr.arpa" IN {<br />
type master;<br />
file "/etc/bind/db.192";<br />
};<br />
//the same case that db.192 it is just the name so we can but anything we want <br />
</div><br />
Secondly, we have to configure file of each zones (forward and reverse zone) <br />
Forward zone: db.infosec.com<br />
<pre> The configuration template have been made similar to the db.local so we can copy that file to be our file (db.infosec.com) and db.192 is the same structure too.</pre> <br />
* Sudo cp /etc/bind/db.local /etc/bind/db.infosec.com<br />
* Sudo nano /etc/bind/db.infosec.com<br />
<div style="border : 2px solid gray "><br />
; BIND data file for local loopback interface<br />
:: $TTL 604800<br />
:: @ IN SOA server.infosec.com. root.server.infosec.com. (<br />
2 ; Serial<br />
604800 ; Refresh<br />
86400 ; Retry<br />
2419200 ; Expire<br />
604800 ) ; Negative Cache TTL<br />
;<br />
<br />
::@ IN NS server.infosec.com.<br />
<br />
::@ IN A 192.168.0.2<br />
<br />
::server IN A 192.168.0.2<br />
<br />
::host IN A 192.168.0.2<br />
<br />
::client IN A 192.168.0.3<br />
<br />
::client1 IN A 192.168.0.3<br />
<br />
; server and host is the name that we set for machine 192.168.0.2 (DNS Server) <br />
<br />
; client and client1 are the name that we set for machine 192.168.0.3<br />
<br />
</div><br />
<br />
* Sudo cp /etc/bind/db.infosec.com /etc/bind/db.192<br />
* Sudo nano /etc/bind/db.192 <br />
<br />
<div style="border : 2px solid gray "><br />
<br />
; BIND data file for local loopback interface<br />
<br />
:: $TTL 604800<br />
<br />
:: @ IN SOA server.infosec.com. root.server.infosec.com. (<br />
2 ; Serial<br />
604800 ; Refresh<br />
86400 ; Retry<br />
2419200 ; Expire<br />
604800 ) ; Negative Cache TTL<br />
;<br />
::@ IN NS server.infosec.com.<br />
::@ IN PTR infosec.com<br />
::server IN A 192.168.0.2<br />
::host IN A 192.168.0.2<br />
::client IN A 192.168.0.3<br />
::client1 IN A 192.168.0.3<br />
::2 IN PTR server.infosec.com<br />
::3 IN PTR client.infosec.com<br />
</div><br />
<br />
Thirdly, we have to configure our network address and resolv.conf file<br />
<br />
To configure the network interface as we use version 20.0 so it is configured by netplan. <br />
* Sudo nano /etc/netplan/file_name <br />
<br />
File_name it is already created so we can go to that location we will get it. The apply this configuration<br />
<br />
<div style="border : 2px solid gray "><br />
<pre><br />
network:<br />
ethernets:<br />
eth0:<br />
dhcp4: no<br />
addresses: [192.168.0.2/24]<br />
gateway4: 192.168.0.1<br />
nameservers:<br />
search: [infosec.com]<br />
addresses: [192.168.0.2]<br />
<br />
</pre><br />
</div><br />
<br />
Then we have to write this command to apply the configuration<br />
* Sudo netplan apply <br />
Finally, we have to configure resolv.conf<br />
* Sudo nano /etc/resolv.conf<br />
<br />
<div style="border : 2px solid gray "><br />
Nameserver 192.168.0.2<br />
Search infosec.com <br />
</div><br />
For client side we use configure network address like the interface above but with different IP address and set resolv.conf the same as DNS server. <br />
<br />
=== Testing ===<br />
<pre><br />
To test if our configuration is correct or not, we can use ping and nslookup.<br />
- If you use ping it will respond, even you use IP or name of server. <br />
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.<br />
64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.104 ms<br />
64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.093 ms<br />
64 bytes from 192.168.0.2: icmp_seq=3 ttl=64 time=0.069 ms<br />
- Using ping with name<br />
PING server.reatrey.com (192.168.0.2) 56(84) bytes of data.<br />
64 bytes from server.reatrey.com (192.168.0.2): icmp_seq=1 ttl=64 time=0.060 ms<br />
64 bytes from server.reatrey.com (192.168.0.2): icmp_seq=2 ttl=64 time=0.083 ms<br />
64 bytes from server.reatrey.com (192.168.0.2): icmp_seq=3 ttl=64 time=0.070 ms<br />
<br />
</pre><br />
<h1 > Hope You Can Make It Works As I did </h1></div>Rpichhttps://doc.infosec.unamur.be/index.php?title=Install_DNS_in_raspberry_pi&diff=1007Install DNS in raspberry pi2021-11-19T11:23:42Z<p>Rpich: /* Local DNS Installation Procedure Using Raspberry Pi */</p>
<hr />
<div>==Local DNS Installation Procedure Using Raspberry Pi==<br />
<br />
=== Requirement and Devices ===<br />
# Devices check-list <br />
#* Two Raspberry Pi (server, client) + 16GB SD Card <br />
#* Networking devices: switch, network Cable, Router , Keyboard and Mouse. <br />
# Technology<br />
#* Raspberry Pi Ubuntu Server Operating System<br />
#**Reference: https://ubuntu.com/download/raspberry-pi<br />
#*Raspberry Pi Imager<br />
#**Reference: https://www.raspberrypi.org/software/<br />
#**Putty for remote ssh to our Raspberry Pi<br />
#**Reference: https://www.putty.org/<br />
#System Physical Architecture<br />
[[Image:abc.png|thump|Architecture]]<br />
===Installation Process===<br />
====We assume that: ====<br />
* Both Raspberry Pi have been installed ubuntu server operating system<br />
* Our local network has been connected to internet and local network with LAN: 192.168.0.1/24 (gateway: 192.168.0.1)<br />
=====DNS Server:===== <br />
* Hostname: server.inforsec.com<br />
* IP address: 192.168.0.2<br />
=====DNS Client:=====<br />
* Hostname: client.infosec.com<br />
* IP address: 192.168.0.3<br />
=====DNS Package Installation=====<br />
we use bind9 package for our DNS server and dnsutils for troubleshooting tool<br />
* sudo apt install bind9 dnsutils<br />
=====DNS File Configuration=====<br />
After we installed the packaged in our DNS server, we will get the configuration folder in /etc/bind/<br />
* /etc/bind/named.conf.options: global DNS options<br />
* /etc/bind/named.conf.local: for your zones<br />
* /etc/bind/named.conf.default-zones: default zones such as localhost, its reverse, and the root hints<br />
First of all we have to configure our zones so we have domain zone and IP zone (forward zone and reverse zone) <br />
* Sudo nano /etc/bind/named.conf.local<br />
then we add the configuration of both zones into file <br />
<br />
Note:for indenting we can’t use tab button, we have to use space button<br />
<br />
Forward zone and Reverse zone:<br />
<div style="border : 2px solid gray "> <br />
<br />
zone "infosec.com" IN {<br />
type master;<br />
file "/etc/bind/db.infosec.com";<br />
};<br />
//db.infosec.com it is just the name so we can put anything we want <br />
<br />
zone "0.168.192.in-addr.arpa" IN {<br />
type master;<br />
file "/etc/bind/db.192";<br />
};<br />
//the same case that db.192 it is just the name so we can but anything we want <br />
</div><br />
Secondly, we have to configure file of each zones (forward and reverse zone) <br />
Forward zone: db.infosec.com<br />
<pre> The configuration template have been made similar to the db.local so we can copy that file to be our file (db.infosec.com) and db.192 is the same structure too.</pre> <br />
* Sudo cp /etc/bind/db.local /etc/bind/db.infosec.com<br />
* Sudo nano /etc/bind/db.infosec.com<br />
<div style="border : 2px solid gray "><br />
; BIND data file for local loopback interface<br />
:: $TTL 604800<br />
:: @ IN SOA server.infosec.com. root.server.infosec.com. (<br />
2 ; Serial<br />
604800 ; Refresh<br />
86400 ; Retry<br />
2419200 ; Expire<br />
604800 ) ; Negative Cache TTL<br />
;<br />
<br />
::@ IN NS server.infosec.com.<br />
<br />
::@ IN A 192.168.0.2<br />
<br />
::server IN A 192.168.0.2<br />
<br />
::host IN A 192.168.0.2<br />
<br />
::client IN A 192.168.0.3<br />
<br />
::client1 IN A 192.168.0.3<br />
<br />
; server and host is the name that we set for machine 192.168.0.2 (DNS Server) <br />
<br />
; client and client1 are the name that we set for machine 192.168.0.3<br />
<br />
</div><br />
<br />
* Sudo cp /etc/bind/db.infosec.com /etc/bind/db.192<br />
* Sudo nano /etc/bind/db.192 <br />
<br />
<div style="border : 2px solid gray "><br />
<br />
; BIND data file for local loopback interface<br />
<br />
:: $TTL 604800<br />
<br />
:: @ IN SOA server.infosec.com. root.server.infosec.com. (<br />
2 ; Serial<br />
604800 ; Refresh<br />
86400 ; Retry<br />
2419200 ; Expire<br />
604800 ) ; Negative Cache TTL<br />
;<br />
::@ IN NS server.infosec.com.<br />
::@ IN PTR infosec.com<br />
::server IN A 192.168.0.2<br />
::host IN A 192.168.0.2<br />
::client IN A 192.168.0.3<br />
::client1 IN A 192.168.0.3<br />
::2 IN PTR server.infosec.com<br />
::3 IN PTR client.infosec.com<br />
</div></div>Rpichhttps://doc.infosec.unamur.be/index.php?title=Install_DNS_in_raspberry_pi&diff=1006Install DNS in raspberry pi2021-11-19T10:41:54Z<p>Rpich: Created page with "==Local DNS Installation Procedure Using Raspberry Pi== #Requirement and Devices #* Devices check-list #** Two Raspberry Pi (server, client) + 16GB SD Card #** Networking..."</p>
<hr />
<div>==Local DNS Installation Procedure Using Raspberry Pi==<br />
<br />
#Requirement and Devices <br />
#* Devices check-list <br />
#** Two Raspberry Pi (server, client) + 16GB SD Card <br />
#** Networking devices: switch, network Cable, Router , Keyboard and Mouse. <br />
#* Technology<br />
#** Raspberry Pi Ubuntu Server Operating System<br />
#***Reference: https://ubuntu.com/download/raspberry-pi<br />
#**Raspberry Pi Imager<br />
#***Reference: https://www.raspberrypi.org/software/<br />
#**Putty for remote ssh to our Raspberry Pi<br />
#***Reference: https://www.putty.org/<br />
#*System Physical Architecture<br />
[[File:Abc.png|thumb]]</div>Rpichhttps://doc.infosec.unamur.be/index.php?title=File:Abc.png&diff=1005File:Abc.png2021-11-19T10:40:57Z<p>Rpich: </p>
<hr />
<div>Architeture</div>Rpichhttps://doc.infosec.unamur.be/index.php?title=DNS&diff=1004DNS2021-11-19T10:15:11Z<p>Rpich: Created page with "install DNS in raspberry pi"</p>
<hr />
<div>[[install DNS in raspberry pi]]</div>Rpichhttps://doc.infosec.unamur.be/index.php?title=Main_Page&diff=932Main Page2021-08-23T07:46:41Z<p>Rpich: </p>
<hr />
<div>'''Welcome to the IoT & InfoSec Wiki'''<br />
<br />
The goal of this wiki is to serve as a lightweight communication vector and repository to share and keep any information we think could be useful to others and that related to the following topics:<br />
* Research Topics<br />
** [[IoT|Internet of Things]]<br />
**[[Blockchain]]<br />
**[[DNS]]<br />
<br />
*[[internships|Internships]]<br />
* Misc<br />
**[[CSC|Cyber Security Challenge]]<br />
**[[PdS18MovieMistakes|PdS'18 : Movie Mistakes]]<br />
** [[Infra:websiteinfosec|Website Infosec]]<br />
** [[Infra:snowwhite|SnowWhite Infrastructure]]<br />
** [[Infra:connection|Connection to team tools]]<br />
** [[Infra:members|Managing members tools access]]<br />
* Project proposals<br />
** [[TorProjectProposal| How does Tor work ?]]<br />
<br />
[[:File:MediaWikiRefCard.pdf|Reference Card for MediaWiki document syntax]]</div>Rpich