Systems Admin – Bootcamp


Setup

Groups – 20 (5 Members each)

Prerequisites

  • Atleast one laptop per group
  • SSH agent (Linux – Already installed, Windows – Putty)

Wireless Connectivity

  • ssid – Workshop
  • key – 8888888888

Virtual Machines (VMs)

  • Group 1 – 10.10.0.1
  • Group 2 – 10.10.0.2
  • .
  • Group 20 – 10.10.0.20

VM Details

  • username: sysadm
  • password: nsrc+ws

Emails

IMAP/IMAPS – 143/993

POP3/POP3S – 110/995

SMTP/SMTPS – 25/465

Email Clients – Microsoft Outlook, Windows Live Mail, or Mozilla Thunderbird

Configure DHCP Server

sudo apt-get install isc-dhcp-server

You also need to edit /etc/default/isc-dhcp-server to specify the interfaces dhcpd should listen to. By default it listens to eth0. 

# Sample /etc/dhcpd.conf
# (add your comments here) 
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.10.255;
option routers 10.10.10.254;
option domain-name-servers 10.10.10.1, 196.43.140.250 ;
option domain-name "ws.ucu.ac.ug";

subnet 10.10.10.0 netmask 255.255.255.0 {
range 10.10.10.10 10.10.10.100;
range 10.10.10.150 10.10.10.200;
} 

Start and stop service

 sudo service isc-dhcp-server restart
 sudo service isc-dhcp-server start
 sudo service isc-dhcp-server stop 

Configure a DNS Server

sudo apt-get update

sudo apt-get install bind9

Cache Nameserver

Open /etc/bind/named.conf.options file and find forwarders column , uncomment and edit like the following.

forwarders {

8.8.8.8;

8.8.4.4;

};

sudo service bind9 restart

Now test using dig command . open /etc/resolv.conf and edit nameserver ip to 127.0.0.1 or your serverIP.

nameserver 127.0.0.1

Now type the below command to see results.

krizna@ns:~$ dig www.google.com

................

;; Query time: 83 msec

;; SERVER: 127.0.0.1#53(127.0.0.1)

.................

It took 83 msec for the first time . Now try the same command again.

krizna@ns:~$ dig www.google.com

................

;; Query time: 5 msec

;; SERVER: 127.0.0.1#53(127.0.0.1)

.................

Now reduced to 5 msec . This time it serves from local.

Primary master

Primary master configuration is just like managing DNS records for particular domain locally ( Eg: ws.ac.ug ).

Scenario details:

Domain name : ws.ac.ug

Server ip : 10.10.0.x

Server hostname : ns.ws.ac.ug

Webserver ip : 10.10.0.241 ( www.ws.ac.ug) .

We need to create 2 zone files , Forward zone and reverse zone.

Forward zone file

Create forward zone file db.ws.ac.ug by copying db.local conf file.

sudo cp /etc/bind/db.local /etc/bind/db.ws.ac.ug

Now open /etc/bind/db.ws.ac.ug and edit like below.

; BIND data file for local loopback interface

;

$TTL 604800

@ IN SOA ns.ws.ac.ug. root.ns.ws.ac.ug. (

2 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS ns.ws.ac.ug.

@ IN A 10.10.0.x

ns IN A 10.10.0.x

www IN A 10.10.0.241

Reverse zone file

Create reverse zone file db.127 by copying db.10 conf file.

sudo cp /etc/bind/db.127 /etc/bind/db.10

Now open /etc/bind/db.10 file and edit like below.

; BIND reverse data file for local loopback interface

;

$TTL 604800

@ IN SOA ns.ws.ac.ug. root.ns.ws.ac.ug. (

1 ; Serial

604800 ; Refresh

86400 ; Retry

2419200 ; Expire

604800 ) ; Negative Cache TTL

;

@ IN NS ns.

x IN PTR ns.ws.ac.ug.

241 IN PTR www.ws.ac.ug.

Now open /etc/bind/named.conf.local configuration file and add the below lines to include forward and reverse zone files . 6.168.192 in reverse column is just first three octets of your network.

// Forward zone

zone "ws.ac.ug" {

type master;

file "/etc/bind/db.ws.ac.ug";

};

//reverse zone

zone "0.10.10.in-addr.arpa" {

type master;

file "/etc/bind/db.10";

// Forward zone

zone "ws.ac.ug" {

type master;

file "/etc/bind/db.ws.ac.ug";

};

Now restart the service.

sudo service bind9 restart

Now test using nslookup or dig commands.

krizna@ns:~$ nslookup www.ws.ac.ug

Server: 127.0.0.1

Address: 127.0.0.1#53

Name: www.ws.ac.ug

Address: 10.10.0.x

Now test reverse lookup

krizna@ns:~$ nslookup 10.10.0.x

Server: 127.0.0.1

Address: 127.0.0.1#53

x.0.10.10.in-addr.arpa name = www.ws.ac.ug.

That’s it , Your DNS server is ready .

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>