I need a complete step-by-step guide on how to produce such a server configuration.
Can anyone help-me?
|
I need a complete step-by-step guide on how to produce such a server configuration. Can anyone help-me? |
||||
|
|
Complete DNS server in ubuntu server 12.First of all change the ip address of your server form DHCP to STATIC for this use the following command
and add:
Restart networking daemons
Before configuring a DNS server in linux Ubuntu you have to make domain name first and then you will proceed. First you will check your hostname command for this is
(This is my Ubuntu server hostname yours might be different .You can change this according to your need) Now after hostname, you have to make domain name for your server. Say servername.domain.com it is better practice that whenever you are configuring server for home use or so, do not use .com but .hom or .net or whatever you like. Give the below command
add if it does not have it:
In my file 127.0.0.1 is for localhost and I have changed the second IP address 127.0.1.1 with my server IP that is 192.168.1.5 now I enter my domain name having my hostname nefitari first then my domain name autun.hom and then alias nefitari. You can select of your own, hostname.abc.net or hostname.home.lan etc. but remember changing to this file need to restart your server and then login. Restart is must Now install BIND9
After installation just configure the below files step by step
Now configure file named.conf.options This file is use for DNS IPs It mean that your server must connect to some DNS outside. When you buy domain name from ISP’s they normally gives you their own DNS IPs. You can use open DNS IPs of google or so. In my case I am using my own ISP DNS IPs.
***Save the file and exit***using control x press y and overwrite the file Now edit the file named.conf.local This is the file in which we define forward zones and reverse zones. It means that when we enter domain name it will translate it into IP address and when we enter IP address it will simply convert it into name.
will show:
***Save the file and exit***using control x press y and overwrite the file Now we will make these two database files db.autun.hom and db.192 in zones folder First make the directory zones in /etc/bind/
Before making files let me clear you that I have different devices Devices IPs
Now in zones directory we will create two files first db.autun.hom. I am just copying the db.local already present in /etc/bind folder to zones folder by changing its name to db.autun.hom. I will put these IP’s in my db.autun.hom file. Let’s start
Now use the command below to edit the file
Save it and exit
Now create reverse lookup zone file
Now use the command below to edit the file
Save it and exit Now when you are done with your zone file you have to check it whether it is working correctly or not by entering the command below for forward zone file
Now check the reverse zone file
If the output of your named-checkzone is same as above then it is working fine otherwise you made some mistake in file. Now edit the file resolv.conf
Enter the following lines into to your resolv.conf file and save it Restart the bind
After bind start check your setting in log file
it must not have any error in the log Checking forward zones
Output should like this
Now use NSLOOKUP
OUTPUT
Use DIG
Output should similar to the above, check status: NOERROR means it is resolving check ANSWER SECTION: gateway.autun.hom is resolved into 192.168.1.1 Checking reverse zone
Output
If it gives you an error like below
This means that you made some mistake in /etc/bind/named.conf.local file in reverse zone If your server IP is 192.168.1.5 then your reverse zone looks like this
Sometime people made mistake in reversing the ip like (just an example)
Use NSLOOKUP
If you get NXDOMAIN or SERVFAIL like errors it means that one of your zone file is not working correctly Now you can ping ubuntu.com or dig ubuntu.com for the first time it will take several miliseconds to resolve the name ubuntu.com but when you run it second time it will take 1, 2 or 3 seconds normally form 1 to 10 mili seconds are normal and it means that your DNS is working properly Configuring clientswindows side
and here give the IP address (in my case it is 192.168.1.50 have you remember win7pc)
and you are done with it open CMD
it must gives you some replies similarly
it must gives you some replies Test Your Server to Outside World Now you can ping ubuntu.com or dig ubuntu.com for the first time it will take several miliseconds to resolve the name ubuntu.com but when you run it second time, it will take form 1 to 10 mili seconds, its normal time and it means that your DNS is working properly Configuring clients windows side open network connections select change adapter settings select properties select internet protocol version IPv4 and here give the IP address (in my case it is 192.168.1.50 have you remember win7pc) IP address 192.168.1.50 Subnet Mask 255.255.255.0 Default Gateway 192.168.1.1 primary DNS 192.168.1.5 (my new BIND DNS server ip) select Advance (in the same window) select DNS tab Type in the text box below here In DNS Suffix for this connection:autun.hom click ok click on validate setting upon exit click ok and you are done with it open CMD Code:
it must gives you some replies similarly Code:
it must gives you some replies you can use NSLOOKUP Code:
LINUX CLIENTS Code:
type the following lines Code:
Now restart Network Deamons Code:
to force client renew IP command Code:
Now obtain fresh IP: Code:
If you are running DHCP server on your Network then enter the domain name and name server in dhcpd.conf file; for example I have DNS server named nefitari.autun.hom and IP address is 192.168.1.5 like as under Code:
|
|||||||||||||||||||||
|
|
The answer is just an addition to the great description above. Troubleshooting tip Be very careful with the many '.' in the configuration files as each one is important. A single missing '.' can stop the DNS server from working. You should not count on clear error messages. I learned its good practice to use a more telling serial number. Its very important to increment the serial number every time the setup is modified, e.g. new entries being added. If its not incremented a secondary DNS will fail to synchronize the new settings. The suggested format is In Ubuntu 16.04 changing resolv.conf is deprecated. As jdthood writes in his comment replace the step with the following procedure: - Change /etc/default/bind9: the new will should look like this:
see comment from not-a-patch for the IPV6 issues.
Offline Setup The setup is exactly the same, and even a bit easier, since you can just skip the forwarding sections. They do not have to be present, so there is no need to edit the Class-B Networks There are a few minor changes required to make this work for class-B networks (before there are comments, there is no reason why a local network , even at home, could not be a class-B instead of a class-C network). In this example I use the network number 172.20.x.x. (I think the formal notation is 172.20.0.0. for more info google rfc1918). Use the description from the first answer, replace all IPs 192.168.x.x with 172.20.x.x, use for the server IP 172.20.0.100 and modify the files as follows:
The rest is the same. Hope its useful for someone. |
|||||||||
|
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?