Manual For BIND DNS Server On CentOS
Manual For BIND DNS Server On CentOS
2. We'll open the BIND (named) configuration file and make several modifications.
3. Add the private IP address of ns1 to listen to port 53. (Local Machine IP 192.168.12.128)
4. Add the following lines under the options tab in “named.conf” file. (Local/Caching DNS)
recursion yes;
allow-transfer { localhost; };
allow-query { any; };
5. Under the [ view "localhost_resolver" ] add following lines (For Authoritative DNS)
match-clients { any; };
match-destinations { any; };
recursion no;
zone "." IN {
type hint;
file "/var/named/named.ca";
6. Now make the named.conf file and add the following lines.
zone "123.com" {
type master;
file “db.123.com” ;
};
Let's create the directory where our zone files will reside. According to our named.conf configuration,
that location should be /etc/named/zones:
Afterwards go to vi /etc/resolv.conf
www A 203.83.48.116
Stopping named: . [ OK ]
Starting named: [ OK ]
Similarly
1) Install APACHE
2) Create a Directory
The first step in creating a virtual host is to create a directory where we will keep the new website’s
information.
We need to create a new file called index.html within our configurations directory.
We can add some text to the file so we will have something to look at when the IP redirects to the
virtual host.
#Listen 12.34.56.78:80
Listen 80
Scroll down to the very bottom of the document to the section called Virtual Hosts.
NameVirtualHost *:80
# SSL protocol.
# VirtualHost example:
# server name.
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/abc.com
ServerName www.abc.com
ServerAlias abc.com
#ErrorLog /var/www/abc.com/error.log
#CustomLog /var/www/abc.com/requests.log
</VirtualHost>
If want to try out your new virtual hosts without having to connect to an actual domain name (our case)
Vim /etc/hosts
6) Restart Apache
We’ve made a lot of the changes to the configuration. However, they will not take effect until Apache is
restarted.
7) Results