Public DNS Server
HOWTO for E-SMITH 4.1.X
I tested this on E-smith version 4.1.2
Written by Allen (admin@allenscomputing.com)
Before you start:
- To transfer your website to your machine you need to have 2 DNS servers.
Your e-smith machine can be one of them, but you will need a second. This
can be done by a second e-smith machine on a different static IP number.
You can also do this by paying a fee and using a public DNS or having a
friend machine be your secondary DNS server.
Assumptions:
- These instructions assume you have a 2 static IP number (111.222.0.3,
111.222.0.4)
- The E-smith machine is a gateway with two Net cards.
- The Internal IP is 192.168.0.1.
- The new domain you are hosting is: mycompany.com
- Create 2 custom templates for the named.conf files for the Dual DNS
servers (one Internal & one External)
- mkdir /etc/e-smith/templates/etc/named-ext.conf
- mkdir /etc/e-smith/templates-custom/etc/named.conf
- mkdir /etc/e-smith/templates-custom/etc/named-ext.conf
- cp /etc/e-smith/templates/etc/named.conf/* /etc/e-smith/templates-custom/etc/named.conf
- cp /etc/e-smith/templates/etc/named.conf/* /etc/e-smith/templates-custom/etc/named-ext.conf
- Customize the External DNS config file (name-ext.conf)
- Update the "listen on" line in file "15listenon"
From: listen-on \{ 127.0.0.1; { $LocalIP }; \};
To: listen-on \{ { $ExternalIP }; \};
- Add local Host files as "31MyCompany" (use command "pico
31MyCompany")
#-----------------------------------------
# MyCompany.com domain
#-----------------------------------------
zone "mycompany.com" \{
type master;
file "mycompany.host.ext";
\};
- If you have more than one domain create a new host file for each of
them
example: create 31MyDomain or 31company2
- Remove default Local Host file (since the use the 192.168.x.x numbers)
rm 30localhost
- Remove reverse lookup files (since these also have 192.168.x.x numbers)
rm 40localptrs
- Remove the default Domain files (since we will had these by hand)
rm 60domains
- Customize the Internal DNS config file (name.conf)
- Copy domain files from external config directory to Internal directory
cp /etc/e-smith/templates-custom/etc/named-ext.conf/31* /etc/e-smith/templates-custom/etc/named.conf
- Edit all 31 domain files to list the internal files: (example: pico
31MyCompany)
from file "mycompany.host.ext";
to file "mycompany.host.int";
- expand the named config files templates and copy to /home/dns/etc
- /sbin/e-smith/expand-template /etc/named.conf
- /sbin/e-smith/expand-template /etc/named-ext.conf
- cp /etc/named-ext.conf /home/dns/etc
- /**** Step 9 will do a /sbin/e-smith/signal-event console-save which
will copy only the named.conf file. **/
/** any hints on how to get e-smith to automatically copy the named-ext.conf
when Templates are changed would be appreciated **/
- Create mycompany.host.ext zone file in directory /home/dns/var/named
(example: pico /home/dns/var/named/mycompany.host.ext)
@ IN SOA mycompany.com. admin.mycompany.com. (
2001042501 ; Serial
8H ; Refresh
2H ; Retry
7D ; Expire
1D ); Minimum
IN NS ns1
IN NS ns2
IN MX 10 mail
mycompany.com. IN A 111.222.0.3 ;Very important-period after the dot com. (this line only)
ns1 IN A 111.222.0.3
ns2 IN A 111.222.0.4
mail IN A 111.222.0.3
www IN A 111.222.0.3
ftp IN A 111.222.0.3
- Create mycompany.host.int zone file in directory /home/dns/var/named
(example: pico /home/dns/var/named/mycompany.host.int)
@ IN SOA mycompany.com. admin.mycompany.com. (
2001042501 ; Serial
8H ; Refresh
2H ; Retry
7D ; Expire
1D ) ; Minimum
IN NS ns1
IN NS ns2
IN MX 10 mail
mycompany.com. IN A 192.168.0.1 ;Very important-period after the dot com. (this line only)
ns1 IN A 192.168.0.1
ns2 IN A 192.168.0.2
mail IN A 192.168.0.1
www IN A 192.168.0.1
ftp IN A 192.168.0.1
- Edit the inittab file to start two instances of Named
- Update ipchains starting script to allow incoming packets to port 53.
We are limiting the packets to be of type UDP since TCP packages are used
for ZONE update requests.
- Do a console-save command to global update
/sbin/e-smith/signal-event console-save
- Restart the inittab and ipchains
/sbin/e-smith/signal-event remoteaccess-update
- If the remoteaccess-update didn't reset inittab and ipchains, then Reboot the system.
Adding a new Domain to the public dual DNS servers:
Example: How to do DNS for a Friend or host another
Domain as a Virtual Domain
Assume: I am adding Domain PERSONAL.ORG as an IBAY on the same machine
- Customize the External DNS config file (name-ext.conf)
- Customize the Internal DNS config file (name-int.conf)
- Expand the Named Config Files and copy them to the chroot location
(/home/dns/etc)
- /sbin/e-smith/expand-template /etc/named.conf
- /sbin/e-smith/expand-template /etc/named-ext.conf
- cp /etc/named*.conf /home/dns/etc
- Create personal.host.ext zone file in directory /home/dns/var/named
(example: pico /home/dns/var/named/personal.host.ext)
- see step 5 above to example of file contents.
- Create personal.host.int zone file in directory /home/dns/var/named
(example: pico /home/dns/var/named/personal.host.int)
- see step 6 above to example of file contents.
- Restart the Named processes by killing them and init will automatically
respawn new instances of them.
- You can verify killall did it job by running "pidof named"
before and after and you will see that each time it list 2 different pid
showing that 2 instances of named are running.