This document describes the step I took to giving myself a domain.
By no means do I suggest this is the best way, the only way, or even the correct way. It worked. Maybe there is some lurking problem.
I started with an ASDL line with a static IP (213.78.38.102) supplied by British Telecom (BT) through OneTel as a provider. So the goal was simply to have the internet domain name servers point requests to www.hmet.net, ftp.hmet.net, trakis.hmet.net, and mail.hmet.net to the IP address of my connection.
First of all, register a domain. I searched for "domain registration" on google and found an online company that registered domains. I registered my domain hmet.net and had it parked on their site. First step was done.
The next step was to set up a domain server that would propagate the information into the internet. My own personal DNS would tell the internet that www.hmet.net, ftp.hmet.net, trakis.hmet.net, and mail.hmet.net point to my IP. Also, hmet.net accepts email.
Files Editted:
/etc/mail/relay-domains /etc/mail/sendmail.cf /var/named/pz/hmet.net /var/named/pz/213.78.38 /etc/hosts /etc/resolv.conf /var/named/pz/127.0.0 /var/named/root.hints /etc/named.conf
Configure the DNS server (named). (5 files)
The base named configuration file. /etc/named.conf:
options {
directory "/var/named";
};
controls {
inet 127.0.0.1 port 953 allow { localhost; };
};
key "rndc_key" {
algorithm hmac-md5;
secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K"
;
};
zone "." {
type hint;
file "root.hints";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "pz/127.0.0";
};
zone "hmet.net" {
type master;
notify no;
file "pz/hmet.net";
};
zone "38.78.213.in-addr.arpa" {
type master;
notify no;
file "pz/213.78.38";
};
Set the default places to check. Change nothing here. These are the real
places to check.
/var/named/root.hints:
; About any leading spaces in front of the lines here: remove them! ; Lines should start in a ;, . or character, not blanks. ; . 6D IN NS A.ROOT-SERVERS.NET. . 6D IN NS B.ROOT-SERVERS.NET. . 6D IN NS C.ROOT-SERVERS.NET. . 6D IN NS D.ROOT-SERVERS.NET. . 6D IN NS E.ROOT-SERVERS.NET. . 6D IN NS F.ROOT-SERVERS.NET. . 6D IN NS G.ROOT-SERVERS.NET. . 6D IN NS H.ROOT-SERVERS.NET. . 6D IN NS I.ROOT-SERVERS.NET. . 6D IN NS J.ROOT-SERVERS.NET. . 6D IN NS K.ROOT-SERVERS.NET. . 6D IN NS L.ROOT-SERVERS.NET. . 6D IN NS M.ROOT-SERVERS.NET. A.ROOT-SERVERS.NET. 6D IN A 198.41.0.4 B.ROOT-SERVERS.NET. 6D IN A 128.9.0.107 C.ROOT-SERVERS.NET. 6D IN A 192.33.4.12 D.ROOT-SERVERS.NET. 6D IN A 128.8.10.90 E.ROOT-SERVERS.NET. 6D IN A 192.203.230.10 F.ROOT-SERVERS.NET. 6D IN A 192.5.5.241 G.ROOT-SERVERS.NET. 6D IN A 192.112.36.4 H.ROOT-SERVERS.NET. 6D IN A 128.63.2.53 I.ROOT-SERVERS.NET. 6D IN A 192.36.148.17 J.ROOT-SERVERS.NET. 6D IN A 198.41.0.10 K.ROOT-SERVERS.NET. 6D IN A 193.0.14.129 L.ROOT-SERVERS.NET. 6D IN A 198.32.64.12 M.ROOT-SERVERS.NET. 6D IN A 202.12.27.33
The machine itself. Basically says 127.0.0.1 is localhost.
The user.hmet.net is named-ese for user@hmet.net. user is a user who can accept email.
/var/named/pz/127.0.0
$TTL 3D
@ IN SOA ns.hmet.net. user.hmet.net. (
1 ; Serial
8H ; Refresh
2H ; Retry
4W ; Expire
1D) ; Minimum TTL
NS ns.hmet.net.
1 PTR localhost.
The domain. This is the meat of what we are doing. You need to know your true
IP and the IP of your gateway. I don't know what the Serial is supposed to do.
I set the Serial to the date with a 1 at the end.
/var/named/pz/hmet.net:
$TTL 3D
@ IN SOA ns.hmet.net. user.hmet.net. (
200310171 ; Serial
8H ; Refresh 8 hours
2H ; Retry 2 hours
1W ; Expire 1 week
1D ; Minimum 1 day
)
NS ns
MX 10 mail
;
localhost A 127.0.0.1
gw A 213.78.38.103
trakis A 213.78.38.102
ns CNAME trakis
mail CNAME trakis
www CNAME trakis
ftp CNAME trakis
The reverse-name-lookup table. The 102 & 103 correspond to the last digits of the IP numbers in /var/named/pz/hmet.net.
/var/named/pz/213.78.38:
$TTL 3D
@ IN SOA ns.hmet.net. user.hmet.net. (
200310171 ; Serial, todays date + todays serial
8H ; Refresh
2H ; Retry
4W ; Expire
1D ; Minimum TTL
)
NS ns.hmet.net.
103 PTR gw.hmet.net.
102 PTR ns.hmet.net.
102 PTR trakis.hmet.net.
102 PTR mail.hmet.net.
102 PTR ftp.hmet.net.
102 PTR www.hmet.net.
Other odds 'n' ends:
Set the default nameserver to check for DNS queries to be the local machine:
/etc/resolv.conf:
nameserver 127.0.0.1 nameserver 212.67.120.148 search hmet.net
Set the host file to alias hmet.net to the local machine. Not sure if this is entirely correct, nor am I sure which parts are essential. /etc/hosts (on line 18 or thereabouts):
213.78.38.102 trakis hmet.net 213-78-38-102.friaco.onetel.net.uk ns.hmet.net
Set sendmail to relay to hmet.net.
Otherwise it will not accept incoming mail.
/etc/mail/relay-domains:
hmet.net
Set sendmail to masquarade as hmet.net.
That makes it look like user@hmet.net
in outgoing mail, not user@213-78-38-102.friaco.onetel.net.uk
/etc/mail/sendmail.cf (on line 110 or thereabouts):
DMhmet.net
Run /usr/sbin/named to get things started.
To make it permanent, make sure named gets started at bootup.
Try a command like:
if [ -x $/usr/sbin/named -a -x /usr/sbin/ndc ]; then echo -n " named" /usr/sbin/ndc start fi
Finally, return to the website you registered your domain and point the domain name server for your domain to the IP address or name of your machine given by your ISP. For me, that is 213-78-38-102.friaco.onetel.net.uk. I'm not positive about this step. I believe the name of the machine must be something resolvable without the help of my domain name server. But once the address ns.hmet.net is known to the world, 213-78-38-102.friaco.onetel.net.uk can be changed to ns.hmet.net. Sort of a chicken and egg problem.
That's it! Seems more complicated than it has to be. But this worked for me. Good luck!