Add Domain
From SysadminPunk Wiki!
Contents |
Adding a DNS entry into BIND
- Add directive to named.conf
cd /etc/namedb/ cp named.conf named.conf.[DATE] vi named.conf and add directive like one below just edit domain. ===
zone "newdomain.com" {
type master;
file "newdomain.com";
allow-transfer { ns5.dnsmadeeasy.com; ns6.dnsmadeeasy.com; ns7.dnsmadeeasy.com; };
};
- If you need to copy in vi use YANK, to copy and paste 5 lines you would: 5yy (to yank 5 lines) Shift+p (to Paste)
Add Record File
cd /etc/namedb/
Create Forward Lookup Zones
vi db.newdomain.com
$ORIGIN com.
newdomain 86400 IN SOA ns2.mydomain.com. hostmaster.mydomain.com. (
2010072101 3600 600 1814400 3600 )
3600 IN NS ns2.mydomain.com.
3600 IN NS ns5.dnsmadeeasy.com.
3600 IN NS ns6.dnsmadeeasy.com.
3600 IN NS ns7.dnsmadeeasy.com.
3600 IN MX 10 mail.newdomain.com.
3600 IN TXT "Unauthorized use prohibited - NO UCE"
3600 IN A 209.35.35.123
$ORIGIN newdomain.com.
admin 3600 IN A 209.35.35.123
mail 3600 IN A 209.35.35.125
www 3600 IN CNAME newdomain.com
- or for .net
vi db.newdomain.net
$ORIGIN net.
newdomain 86400 IN SOA ns2.mydomain.com. hostmaster.mydomain.com. (
2010072101 3600 600 1814400 3600 )
3600 IN NS ns2.mydomain.com.
3600 IN NS ns5.dnsmadeeasy.com.
3600 IN NS ns6.dnsmadeeasy.com.
3600 IN NS ns7.dnsmadeeasy.com.
3600 IN MX 10 mail.newdomain.com.
3600 IN TXT "Unauthorized use prohibited - NO UCE"
3600 IN A 209.35.35.123
$ORIGIN newdomain.net.}}}
admin 3600 IN A 209.35.35.123
mail 3600 IN A 209.35.35.125
www 3600 IN CNAME newdomain.net
Create Reverse Lookup Zones New
- Depending on where the domain resides we are going to edit the Reverse Lookup File
# vi 35.35.209.in-addr.arpa
- Add entries 1 per line for each host using the last octet of the IP **PLEASE ADD IN NUMERICAL ORDER**
- So for newdomain.com (209.35.35.123) we would add: 123 3600 IN PTR newdomain.com. (Don't forget trailing dot.)
$ORIGIN 35.35.209.in-addr.arpa.
35.35.209.in-addr.arpa. 604800 IN SOA ns2.mydomain.com. hostmaster.mydomain.com. (
2010072203 3600 600 691200 3600 )
3600 IN NS ns2.mydomain.com.
3600 IN TXT "Unauthorized use prohibited - NO UCE"
$ORIGIN 35.35.209.in-addr.arpa.
4 3600 IN PTR mail.mydomain.com.
5 3600 IN PTR mail3.mydomain.com.
6 3600 IN PTR mail2.mydomain.com.
15 3600 IN PTR mydomaincommerce.com.
18 3600 IN PTR mydomain.com.
25 3600 IN PTR mail.mydomain.com.
123 3600 IN PTR newdomain.com.
Restart Named(Bind) when completed with Named.conf, Forward and Reverse Zones.
ndc reload
- Make sure named is running before logging off
# ps aux | grep named root 86 0.0 2.9 5148 3640 ?? Ss 21Jul10 1337:37.24 /usr/sbin/named
Next:Add_Sites_Apache2