Simple BIND config on CentOS 5.x

Running CentOS 5 - fully patched
selinux and iptables are both disabled
bind and bind-chroot installed

I setup a very small network at some offsite trade shows a few times a year.  I setup a web server using Apache.  The server address is 10.10.10.10.  I have clients connect through a Cisco switch for connectivity (and DHCP).  I have them just browse to 10.10.10.10 to hit the application.

I would like to configure bind on that same server and point the switch so that clients use the same IP 10.10.10.10 for DNS.  The 10.10.10.10 needs to have bind configured so that orderentry.companyname.com points to 10.10.10.10.  Therefore, I can tell my users to hit a more familiar URL versus a hard to remember IP address.  

Will someone please guide in creating a simple named.conf file that would work for this?  Also, where should this file be located before attempted to start the named service?

Thanks.  
shannon_adamsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kerem ERSOYPresidentCommented:
Hi,

You can start with named.conf with this:
/* * Companyname BIND configuration */acl companyname {    10.10.10.0/24;};options {        version "12.2.5I";        directory "/var/named";        dump-file "/var/named/data/cache_dump.db";        statistics-file "/var/named/data/named_stats.txt";        allow-transfer { companyname;};        allow-recursion { companyname; };};logging {        category lame-servers { null; };        category client { null; };        channel default_syslog {                syslog daemon;                severity info; };};zone "." in {        type hint;        file "data/named.cache";};zone "0.0.127.in-addr.arpa" in {        type master;        file "data/named.loc";};zone "companyname.com" in {        type master;        file "data/named.hosts.companyname.com";};
A good method is to create a link for it in etc such as:

ln -s /var/named/chroot/var/nammed/etc/named.conf
so that you can edit the file on /etc/named.conf

Then you'll need 3 files. The one is named root file you can get the latest version from here:

wget ftp://ftp.rs.internic.net/domain/named.cache 

and move it to /var/named/chroot/var/named/data

Now create a file for your reverse domain for localhost:

$TTL 86400      ; 1 day@    IN SOA             hostname.companyname.com. root.hostname.companyname.com. (                                201010210101  ; serial                                10800                ; refresh (3 hours)                                3600                  ; retry (1 hour)                                1209600            ; expire (2 weeks)                                86400                ; minimum (1 day)                                )                                NS      hostname.company.com.1                              PTR     localhost.
Now you need the create a zone file:

$TTL 7200       ; 1 day@    IN SOA             hostname.companyname.com. root.hostname.companyname.com. (                                201010210101  ; serial                                10800                ; refresh (3 hours)                                3600                  ; retry (1 hour)                                1209600            ; expire (2 weeks)                                86400                ; minimum (1 day)                                )                              IN   NS      hostname.company.com.                              IN   MX    10, mail                              IN  A       x.x.x.x     localhost                IN  A       127.0.0.1hostname               IN  A       x.x.x.xmail                         IN  A       x.x.x.y

This is t now yo can go and start your named host:

service named start

and check your /var/log/messages to see if there's any problem.

To start the service as you reboot your system issue this:

chkconfig  named on

This should be it for a basic configuration. You can create a reverse zone  for your range x.x.x (you can use named.loc as a template).

Cheers,
K.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mccrackyCommented:
It'd be simpler to setup dnsmasq with a hosts file with local definitions for what you're doing.  

Configuration for dnsmasq is pretty simple in almost all cases. The program has collected a fair few options as it has developed but most of them are not needed most of the time. A machine which already has a DNS configuration (ie one or more external nameservers in /etc/resolv.conf and any local hosts in /etc/hosts) can be turned into a nameserver simply by running dnsmasq, with no options or configuration at all. Set the IP address of the machine running dnsmasq as the DNS server in all the other machines on your network, and you're done.
(From http://www.thekelleys.org.uk/dnsmasq/docs/setup.html)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.