Day 15: DHCP & DNS
Write out what the code specifically does line-by-line
For example:
Line 1: Define a function isPalindrome() that takes in a parameter named string
Line 2: blah blah blah
1 def isPalindrome(string):
2 left_pos = 0
3 right_pos = len(string) - 1
4
5 while right_pos >= left_pos:
6 if string[left_pos] != string[right_pos]:
7 return False
8 left_pos += 1
9 right_pos -= 1
10 return True
sudo apt-get update
sudo apt-get install dnsmasq
cd /etc
sudo mv dnsmasq.conf dnsmasq.default
sudo nano dnsmasq.conf
interface=eth0
dhcp-range=10.4.4.100,10.4.4.254,255.255.255.0,12h
sudo service dnsmasq restart
sudo service networking restart
ifconfig
dhcp-option=6,IP_ADDRESS
no-hosts
addn-hosts=/etc/hosts.dnsmasq
sudo nano /etc/hosts.dnsmasq
sudo nano /etc/resolv.conf
The file should have the following one line only:
nameserver 127.0.0.1
sudo service networking restart