Linux and windows DNS server Setup Tips
QUICK DNS SETUP FOR DSL/CABLE or dialup DNS SETUP for Windows 95,98,ME,2000,NT
Fast setup DHCP none static IP . Open Linuxconf or other app and set too DHCP then open services shut down host,sendmail,telnet these services will hang up for ever so just shut them down then restart. after restart look at you resovl.conf and see if it has two IP's is so you should be connected . To see open term type netstat -r and you should see you 127.0.0.1 localhost then gateway and then eth0 that is your ip. Eth0 is your ethernet/nic card for network connections.
Sendmail requires your MX records to be setup in the DNS records. Host requires a valid host domian name .
Linux 5.0 to 7.2 you can use apache configuration tool . Apache's toll is simple to use just add your machine main domain for single domain setup and if you need to host more than one use your virtual name host <VirtualHost 11.22.33.44>. In virtual name hosting you will use the IP's as the virtual host All newer configuration tools will over write any manual changes made in httpd.conf or named.conf . Making your own DNS Server files manually is Explained below .
This setup will work with the DSL/Cable Enhanced DNS Package (5 IP's) or for the single DSL/Cable IP Package. You can have each Server serve their own Domain. Or service many Domains on one server using Virtual Host. Our Virtual host instructions will come after these main files have been made changed and in place .These same setup files still required in a single domain setup . To get you server to respond to WWW calls use the diagram below showing the use of CNAME. If your using gnome to make these enter this in GNOME will Wright a different zone file . Linuxconf will not add these CNAME lines .These are the hand written ones used as masters .MX EMAIL BELOW 1.1.2
1.1.2 Mail Servers are MX in your domain zone records . If you add your mail server info in this dns setup you will need to add the following line in the file below @ IN MX 5 yourdomain.com. and a second line for backup @ IN MX 10 yourserver.yourdomain.com for email services . 5 is first 10 is second 10 will send 5 if 5 is down momentarily. See domain setup below. First put your domain as IN MX 5 then put your provider as IN MX as 10.
1 . your DNS record located in /var/named the defualt file is local.zone
2 . The Httpd configuration file in /etc/httpd/conf The default file is httpd.conf
3 . The servers main record of all DNS in /etc the default file name is named.conf
TIPS ON MANUAL CHANGES A few rules always use today's date as your serial number 1999122500 add two 00 that give's you 99 changes a day if needed , you might change this file on very few occasions. or during a set up. Check your new domain record for loops.!! that is a domain that points back at itself like ( you.com IN A 11.22.33.44 ) 11.22.33.44 IN A you.com that is Twice in the same record.Short descriptions of the main DNS server files . Each of theses files are part of the resource records "r.r or zone" {boot up calls to these for basic info on location of services Via other IP's}
"Note there is no certain order for all these files as long their all completed before your restart"
Your original file is in (var/named) This is the directory that you will find local.named /var/named/named.local start with this file just because it is all ready correct in its format (The template file) this is one one can start with to past and copy.
/etc/httpd/ is where httpd.conf is this file has lines of configuration for virtual hosting. At bottom you see configure these lines for your Virtual domains as many as needed
Older 4.2 to 5.2 Linux you will need to use mods in these files /etc/httpd in this folder you will find your httpd.conf, srm.conf,access.conf these are file that you will configure if your setting up virtual hosting each of these file will require a small amount of changes .In /etc/httpd/srm.conf you will need to put a # sign it front of DocumentRoot so Virtual configurations will take control of what domain go;s to what directory as seen above in DocumentRoot.
@ IN SOA servername.my.com. myemail.com 1997022718 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum @ IN NS servername.com.
@ PTR localhost.Then save named.local again save it as db.your_domain.com.zone in /var/named directory all newer domain records must end in .zone
Here is an example on how our Local Host db looks. To give you a better reference on how it should be written: This is for reference only cut and past from the above window.
@ IN SOA ns1.beyondinfinity.net. hostmaster.beyondinfinity.net ( 1997022718 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ; Minimum @ IN NS ns1.beyondinfinity.net.
@ IN PTR localhost.
Here we have taken that same file and added a few things and changed a few as well.
1.remove the @ symbol put your domain2 put your host.domain name.com. in place of ours .The servers name
remember put a . (a period to end domain name every where in theses records)3 leave the periods in email address when you change to yours leave serial,refresh,retry,expire,minimum change all green to your domain all blue to your host name all light green for your IP numbers all purple find your local information. All aqua is your email that you will receive errors and notices.
beyondinfinity.net. IN SOA ns1.beyondinfinity.net. jwilmore.pacbell.net. ( 1999022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum @ IN NS ns1.beyondinfinity.net.
@ IN NS ns2.lsan03.pbi.net.@ IN MX 5 Beyondinfinity.net.
@ IN MX 10 ns1.beyondinfinity.net.
beyondinfinity.net. IN A 209.78.213.252
www IN CNAME beyondinfinity.net.
mail IN CNAME beyondinfinity.net.
ftp IN CNAME beyondinfinity.net
Above you see that same file named.local after and now it has www ftp mail and the domain is pointed at your IP. your www points at your domain and to start all this two file alterations need to be made in named.boot & named.conf. In the first file we add a zone this is in named.conf example below,
"Tip" note you will need to direct or redirect the currant to your new
Location. If you place your file in a new zone you will need that path to be specified
example at the top of named.boot&conf the directory for the zone is stated /var/named
if you add zone or other directories you must state them as /zone/db.domain.com that is
one directory up from /var/named so in named.boot & named.conf remember "tip"And next we will add new line for named.boot example below,
SEE EXAMPLE www.beyondinfinity.net/named.conf.html
};zone "123candystore.com"{
type master;
file "123candystore.com.zone";
notify no;
};
zone "123cellularphone.com"{
type master;
file "123cellularphone.com.zone";
notify no;
};
primary domain.com db.domain.com db.domain.com if new directory was added be sure to add a extra /zone in your location of your db file secondary domain.com db.domain.com
In /etc/httpd open the following files http.conf and set document root back one dir to /home/httpd
Below is a example of a reverse lookup from our IP to our name .please use your hosts names and etc. 252.213.78.in-addr.arpa IN SOA ns1.beyondinfinity.net. hostmaster.beyondinfinity.net ( 1999022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ; Minimum IN NS ns1.beyondinfinity.net.
1 IN PTR ns1.beyondinfinity.net.
UPDATE Gnome has come up with a great new lean file but it does not write the two important lines in your zone files one is "www IN CNAME your.com" that is a very necessary element in the to the your.com IN A 2.50.23.43/your IP so that your domain is pointed at that IP. number and you may need to add mail,ftp IN CNAME as well Differences between Gnome and hand written zone files are that hand written are less complicated and loops are less likely to occur and the time outs and time to lives are much shorter.( all at 84000 seconds). All these fine tuning is gone when GNOME writes it version of a zone file .Making good zone files can be a world of difference's in your server ability to answer fast .Hand written file are smaller lean clean files this gets the job done.As to the normal operation of GNOME DNS files is good.
GNOME open Linux conf then go to domain name server find domains 1# add your primary's To use your server name this way is necessary for Virtual hosting .to answer its own domain 2# add your secondary your secondary should be your provider. 3# activate changes. your errors are the key for every fix.
Use Commands for activating changes In linuxconf or gnome choose activate changes and always check you errors In xterm type # ndc restart GNOME use "Activate configuration" + ndc restart Then read your /var/log/messages to see all is ok .If GNOME gives you errors follow then down. To test: run from your terminal type these commands #nslookup + your domain "to identify your self" #netstat -r "to see routing table or route"
#netstat -s for packet and TCP read outs
#dig to see your server is seen by other root server.
- This is a expanded Virtualhost container that is in httpd.conf remember if you change this by hand back it up . Then if you setup the same type of name or IP virthost in apache you wont lose your work . I have always created my conf files by hand first then if necessary ill use the linux conf or apache's tools.
<VirtualHost 11.22.33.44>
ServerName www.yourdomain..com
ServerAdmin you @yourdomain.com
DocumentRoot /home/virtual//home/httpd/html
User yourdomain.com
Group yourdomain.com
Redirect /admin https://11.22.33.33:19000/webhost/services/virtualhosting/siteadmin
Redirect /user https://11.22.33.44:19000/webhost/services/virtualhosting/useradmin
UserDir /home/virtual/yourdomain.com/home/*/public_html
AliasMatch ^/users/([^/]+)/?(.*) /home/virtual/yourdomain.com/home/$1/public_html/$2
ScriptAlias /cgi-bin/ /home/virtual/yourdomain.com/home/httpd/cgi-bin/
CustomLog /home/virtual/yourdomain.com/var/log/httpd/access_log combined
ErrorLog /home/virtual/yourdomain.com/var/log/httpd/error_log
<Directory /home/virtual/yourdomain.com/home/httpd/html/>
#Allow from all
AllowOverride All
#Order allow,deny
Options Includes
Options ExecCGI
</Directory>
<Directory /home/virtual/yourdomain.com/home/httpd/cgi-bin/>
AllowOverride All
Options +ExecCGI
</Directory>
</VirtualHost>
www.beyondinfinity.net