views:

55

answers:

1

Okay, at the moment i have my domain's host file which was generated by the Webmin control panel. I have a box to myself with several IPs and i want to make use of more than one. I don't fully understand everything to do with host files but I know enough to get by. Can anyone suggest how i would go about changing the below host file to make my two name servers and mail server have their own IPs and then my domains and sub domains share another?

$ttl 120
@       IN      SOA     ns1.example.com. webmaster.example.com. (
                        1283718781
                        1D
                        120
                        7D
                        120 )
example.com.    IN      NS      ns1.example.com.
example.com.    IN      A       192.168.0.1
www.example.com.        IN      A       192.168.0.1
ftp.example.com.        IN      A       192.168.0.1
m.example.com.  IN      A       192.168.0.1
localhost.example.com.  IN      A       127.0.0.1
webmail.example.com.    IN      A       192.168.0.1
admin.example.com.      IN      A       192.168.0.1
mail.example.com.       IN      A       192.168.0.1
example.com.    IN      MX      5 mail.example.com.
example.com.    IN      NS      ns2.example.com.

[edit] Just to add, can you also suggest any improvements because at present initial loading of the website is slow, i did a dns test from an online tool and resolving was taking a long while. After the first page load the site's home page then loads in less than 2 seconds, presumably because stuff has been cached after the first load.

please and thanks in advance for any help.

+1  A: 

I'm not sure if I understood your question but I would use following zone file for example.com domain:



$ttl 120
@       IN      SOA     ns1.example.com. webmaster.example.com. (
                        2010091401 ; Serial format YYYYmmddXX where XX is 01-99
                        1D
                        120
                        7D
                        120 )
                IN      NS      ns1.example.com.
                IN      NS      ns2.example.com.
                IN      MX      5 mail.example.com.
                IN      A       192.168.0.1
ns1             IN      A       192.168.xxx.xxx ; ns1 ip
ns2             IN      A       192.168.xxx.xxx ; ns2 ip
www             IN      A       192.168.0.1
ftp             IN      A       192.168.0.1
m               IN      A       192.168.0.1
webmail         IN      A       192.168.0.1
admin           IN      A       192.168.0.1
mail            IN      A       192.168.0.1
localhost       IN      A       127.0.0.1
Pekka
ahh i see, that answers what i wanted to know. It was specifying the ip addresses for the two name servers that i wasn't clear on. I was under the impression that it had to be a NS record that the IPs are pointed to but in fact you just create to two subdomains with normal A records pointing to different IPs. thank you
robinsonc494