Open main menu

CDOT Wiki β

Changes

OPS335 DNS Lab

18 bytes removed, 14:17, 14 January 2015
m
Updating machine names
Fully Qualified Domain Name IP Address
host.<learnid>.org 192.168.X.1
vm01vm1.<learnid>.org 192.168.X.2 vm02vm2.<learnid>.org 192.168.X.3 vm03vm3.<learnid>.org 192.168.X.4
<br />
* Create the file /var/named/localhost.zone and enter the following (note: if you copy-paste this code, there should be NO leading spaces before the "@" or the "$"):
$TTL 3D
@ IN SOA vm01vm1.<learnid>.org. webmaster.<learnid>.org. (
1 ; Serial
8H ; Refresh
$TTL 3D
@ IN SOA vm01vm1.<learnid>.org. webmaster.<learnid>.org.(
1 ; Serial
8H ; Refresh
1D ; Negative Cache TTL
);
@ IN NS vm01vm1.<learnid>.org. vm01 vm1 IN A 192.168.X.2
*Next, edit /var/named/mydb-for-192-168-X and enter the following:
$TTL 3D
@ IN SOA vm01vm1.<learnid>.org. webmaster.<learnid>.org. (
1 ; Serial
8H ; Refresh
1D ; Negative Cache TTL
);
@ IN NS vm01vm1.<learnid>.org. 2 IN PTR vm01vm1.<learnid>.org.
*Now set up your resolver to point to itself. Edit /etc/resolv.conf, delete what's there and enter this data instead. Remember to use your value for X.
*Try a few lookups:
host host.<learnid>.org
host vm01vm1.<learnid>.org host vm02vm2.<learnid>.org host vm03vm3.<learnid>.org
host cbc.ca
*Now try a few reverse lookups:
host 192.168.X.4
*You'll notice that only the queries for vm01 vm1 worked. That's because you only have the resource records for vm01vm1. Go back to the zone files and add the appropriate records for your other machines.
**Once you have done so, restart the service and try querying for those records again.
*Add rules to your iptables to allow the other machines in your network to query your new DNS server.
**Now try the commands
host host.<learnid>.org
host vm01vm1.<learnid>.org host vm02vm2.<learnid>.org host vm03vm3.<learnid>.org
host yahoo.ca
**And the commands
932
edits