Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Configuring DNS on CentOS 5.2 server

Posted on 2008-10-16
10
Medium Priority
?
8,768 Views
Last Modified: 2012-06-27
I just installed a server running CentOS 5.2 and plan on using it as a web server.  I need to enable DNS and have app.testcomp.com point to //10.10.10.158//var/www/html.  Clients will get their IP from DHCP running on this server.  The server IP is 10.10.10.158.  Will someone please lead me through this?
0
Comment
Question by:shannon_adams
  • 6
  • 3
10 Comments
 
LVL 29

Expert Comment

by:Michael Worsham
ID: 22737674
Do you want the server to act as a DNS server plus a web server or just have the Apache instance be able to handle DNS lookup names and point them to the correct directory structure (i.e. virtual hosts)?

0
 
LVL 29

Expert Comment

by:Michael Worsham
ID: 22737730
For expandibility and ease of support, I recommend not using the /var/www/html directory and create a directory like /web (base directory) and /var/web (log files) and using it for all of the domains you wish to house/support.

Under your /etc/httpd/conf, modify the httpd.conf and add the following line at the end:

Include /etc/httpd/conf/virthosts.conf

Then under the same /etc/httpd/conf directory, create a file called virthosts.conf and fill in the information provided below.

NameVirtualHost *:80
 
<VirtualHost *:80>
 ServerName app.testcomp.com 
 ServerAlias www.app.testcomp.com
 DocumentRoot /web/app.testcomp.com/htdocs
 ErrorLog /var/web/app.testcomp.com/error_log
 CustomLog /var/web/app.testcomp.com/access_log common
 ScriptAlias /cgi-bin/ "/web/app.testcomp.com/htdocs/"
 <Directory /web/app.testcomp.com>
     Options Indexes FollowSymLinks Multiviews +Includes
     AllowOverride All
 </Directory>
</VirtualHost>

Open in new window

0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22740532
HI
you asked , how to configure dns server, but after reading your question , its seems like you want to configure as webserver,

which one you want to configure ??

for dns server, you need to install bind
and have to configure named.conf

you can follow wnat  mwecomputers said to configure apache,
or you can follow this tutorial about configureing binds and apache
http://www.howtoforge.com/creating-your-own-webserver-with-bind-and-apache-centos5
let me know if you need any help
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:shannon_adams
ID: 22744984
Under the /etc/httpd/conf, I modified the httpd.conf and add the following line at the end:
Include /etc/httpd/conf/virthosts.conf
Then under the same /etc/httpd/conf directory, created virthosts.conf

Basically, this is a web server that needs to provide dhcp.  I need a virtual host so that when a client connects to the server, it can browse to app.testcomp.com.

Here is my /etc/dhcpd.conf

ddns-update-style interim;
ignore client-updates;

subnet 10.10.10.0 netmask 255.255.255.0 {

# --- default gateway
        option routers                  10.10.10.1;
        option subnet-mask              255.255.255.0;

        option nis-domain               "testcomp.com";
        option domain-name              "testcomp.com";
        option domain-name-servers      10.10.10.158;

        option time-offset              -18000; # Eastern Standard Time
#       option ntp-servers              10.10.10.158;
#       option netbios-name-servers     10.10.10.158;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
#       option netbios-node-type 2;

        range dynamic-bootp 10.10.10.10 10.10.10.150;
        default-lease-time 21600;
        max-lease-time 43200;

        # we want the nameserver to appear at a fixed address
        host ns {
                next-server marvin.redhat.com;
                hardware ethernet 12:34:56:78:AB:CD;
                fixed-address 207.175.42.254;
        }

DHCP is working fine.

The virtual host is the problem.  I changed /etc/httpd/conf/httpd.conf and added the following line at the end:
Include /etc/httpd/conf/virthosts.conf

Here is virthosts.conf:
NameVirtualHost *:80

<VirtualHost *:80>
 ServerName app.testcomp.com
 ServerAlias www.app.testcomp.com
 DocumentRoot /var/www/html
 ErrorLog logs/error_log
 CustomLog logs/access_log common
 ScriptAlias /cgi-bin/ "/var/www/html/"
 <Directory /var/www/html>
     Options Indexes FollowSymLinks Multiviews +Includes
     AllowOverride All
 </Directory>
</VirtualHost>

The named service starts fine, but the client cannot ping app.testcomp.com or browse to it.  ipconfig shows:
Connection-specific DNS Suffix: testcomp.com
IP Address:  10.10.10.150
Subnet Mask:  255.255.255.0
Default Gateway:  10.10.10.1

I appreciate any help getting me through this.
0
 
LVL 29

Expert Comment

by:Michael Worsham
ID: 22745046
Do you have a DNS CNAME entry for 'app' that points to the same IP address as the server?
0
 
LVL 29

Expert Comment

by:Michael Worsham
ID: 22745073
Oops. A DNS 'A record' entry for app that points to 10.10.10.150?
0
 

Author Comment

by:shannon_adams
ID: 22745079
No, I don't.  Where would I put that?
0
 
LVL 29

Expert Comment

by:Michael Worsham
ID: 22745101
First of all, are you going to have the DNS located on the same server as the web host or a seperate server or external host?
0
 

Author Comment

by:shannon_adams
ID: 22745119
This server is standalone and will not be hooked to the Internet or any other network.
0
 
LVL 29

Accepted Solution

by:
Michael Worsham earned 1500 total points
ID: 22745175
You will need to configure/setup named.conf for youe environment, then create a zone file (commonly referred to as a 'DNS stub file' for your domain name. Inside the zone file, this is where you would have your main A record, MX records, subdomain records, etc.

Setting up a local DNS (BIND/Named) is not as easy as it looks, so it will take a bit of trial and error.
http://www.brennan.id.au/08-Domain_Name_System_BIND.html
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question