This might be a beginners topic for most of the people out there, but the dns setup can be a bit confusing. This is just a short guide for how to setup an easy setup. Nothing complicated, and no fancy-pancy setup. This example will show how to setup an domain example.tld with three sub domains and mail.
I know subdomains can be setup as wildcards, CNAME and A-records, but right now I use A-record for the subdomains. To just get it going we will consentrate of just getting it working with the following configuration.
Domain: example.tld
Subdomains: mail, admin, mysql
IP: 1.2.3.4
Now we will start by adding the domain to the named.conf – Though it might not be present at this path you might need to search for it. (Using for example webmin would help you show all configuration files).
# vi /etc/named.conf
Add a new zone to named.conf
zone “example.tld” {
type master;
file “/var/named/example.tld.hosts”;
};
Save the configuration
Push escape, then : x
The next step is creating the DNS records. Add a new file to bind.
# vi /var/named/example.tld.hosts
In this file you will create your DNS-records.
$ttl 15m ; TTL Might be smart to have at 15 minutes until your conf are ok
example.tld. IN SOA ns.example.tld. user.example.tld. (
123456789 ;An unique number
86000 ;Refresh rate in seconds
7200 ;Update Retry in seconds
3600000 ;Expiry in seconds
600 ; minimum in seconds
)example.tld. IN NS ns.example.tld.
example.tld. IN A 1.2.3.4
www.example.tld. IN CNAME example.tld
mail IN A 1.2.3.4
admin IN A 1.2.3.4
mysql IN A 1.2.3.4
mail.example.tld. IN MX 1 example.tld.
Now save the file and restart BIND
# service bind restart










