FreeBSD Server Administration

September 27, 2005

Sample of BIND Configuration Files

I noticed a few visitors came to this blog by searching BIND configuration errors. I had troubles too, later simply copied the configuration files from a Linux server. Here are my configuration files of BIND 9, if you have troubles to make BIND work, you can use them directly or as a starting point. Please note that you may need to convert the text to unix Format, and those steps in the handbook should be done first:
# cd /etc/namedb
# sh make-localhost

Add named_enable="YES" to /etc/rc.conf

My server is a typical dedicated server and doesn't rely on any other servers, everything is on this box, such as dns, email, web server, ftp, etc.

In the sample files, I have a main domain "maindomain.com" for the server, the host name is "hostname.maindomain.com", DNS servers for all domains on this server are "ns1.maindomain.com" and "ns2.maindomain.com". All other domains can be configured like "otherdomain.com".

/etc/namedb/named.conf

Continue reading "Sample of BIND Configuration Files"

Posted by FreeBSD Newbie at 09:54 PM | Comments (1)

January 07, 2005

DNS Setup

Unfortunately I stuck at the DNS setup, I have read the handbook many times, but still don't have a clear idea about it.

Here is what I have done yesterday:
1. Running bind 9 (doc).
Create a zone file according to the example in the handbook, but later I found it's for bind 8, someone told me bind 9 is quite different. I got a bind 9 zone sample from the Internet, it didn't work either. named-checkzone checking got the following error message:

mydomain.com:1: unknown RR type 'mydomain.com.'
mydomain.com:19: using RFC 1035 TTL semantics
mydomain.com:20: ignoring out-of-zone data (mydomain.com)
dns_rdata_fromtext: mydomain.com:29: near '#': extra input text
mydomain.com:30: ignoring out-of-zone data (mydomain.com)
dns_rdata_fromtext: mydomain.com:30: near '#': extra input text
zone myaccount/IN: loading master file mydomain.com: unknown class/type

Useful commands
Start/stop/restart bind, this also applies to most other common services.
# /etc/r0.d/named start[stop/restart/status]

Check zone file
# /usr/sbin/named-checkzone account_name zonefile

Check latest error message
# tail /var/log/messages


2. Running Apache (doc)
Create virtual host entry in Apache configuration file. The website can be accessed by IP address.

Apache configuration file is at /usr/local/etc/apache/httpd.conf on FreeBSD.

Apache is one of the few services which don't run from inetd according to the handbook.
# /usr/local/sbin/apachectl start[stop/restart]

Restart Apache without aborting current connections, this is very interesting to me, never heard of it.
# /usr/local/sbin/apachectl graceful

A nice admin in the IRC room logined my server to help me locate the problem, but failed to fix it. Although I didn't make the website up and running, I learnt many things during the process.

I'm too lazy to work on it today, anyway I'm not in rush.

Posted by FreeBSD Newbie at 03:48 AM | Comments (0)