vmware, FreeBSD, BIND and Apache

I need to create a virtual machine using vmware, install FreeBSD on that VM, install and configure BIND, Apache, PHP and MySQL and finally install joomla. This is a part of my class project. I have experinece with windows, ubuntu and centos web servers, but this is new for me.

So far, I have configured VM, FreeBSD, BIND and Apache. I had problem with, network, static IP, gateway, but now everthing looks OK, except I cannot ping local domain.

I can ping domains and IP adresses out of my network. I can ping localhost and my own IP adress (192.168.1.10). From another computers on the network I can acess apache default webpage by typing IP adress 192.168.1.10 in url bar, but when I type mydomain.com it can find it.

this is mydomain.com file (that is not the real name of my domain)

Code:
$TTL 3600

mydomain.com. IN SOA webserver.mydomain.com. root.mydomain.com. (
1 : Serial
10800 : Refresh
3600 : Retry
604800 : Expire
86400 : Minimum TTL

)
mydomain.com. IN NS webserver.mydomain.com.
webserver.mydomain.com. IN A 192.168.1.10
www IN CNAME webserver.mydomain.com.
mydomain.com. IN MX 10 mailserver.mydomain.com

Does anybody have any idea what I did wrong?
 
DNS domains don't 'magically' appear on a network. A client that needs to resolve something will query it's configured nameservers. If those nameservers don't know about this domain the lookup will fail. So you will need to configure your client to use your DNS server.
 
How I can do that. Some hints?

/etc/rc.conf

Code:
hostname webserver.mojeime.com
keymap."hr.iso.kbd"
ifconfig_em0="192.168.1.10 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
sshd_enable="YES"
dumpdev="AUTO"
named_enable="YES"
apache22_enable="YES"
apache22_http_accept_enable="YES"

/etc/resolv.conf

Code:
search localdomain
nameserver 192.168.1.10
 
Yes, those settings are for your FreeBSD machine, not for your other computers. They need to use the DNS server you have running on FreeBSD.
 
When I ping mydomain.com from my FreeBSD machine I still get message

Code:
ping: cannot resolve mydomain.com: Host name lookup failure

So I can't ping my domain from my FreeBSD machine.
 
mt82 said:
Code:
webserver.mydomain.com. IN A 192.168.1.10
This should be just webserver. It's defined under the domain so you don't have to supply it.

Code:
webserver   IN A 192.168.1.10
 
1. Did named really start? Run: # sockstat -4

2. If it did start, does /var/log/messages have anything to say about the zone it loaded?

3. Did you edit named.conf and what did you change?
 
You forgot an A record for the mailserver, comments start with a semicolon and you missed a trailing period for the MX RR:
Code:
$TTL 3600

mydomain.com.	IN	SOA	webserver.mydomain.com. root.mydomain.com. (

				201302271	;Serial
				10800		;Refresh
				3600		;Retry
				604800		;Expire
				86400)		;Minimum TTL

mydomain.com.	IN	MX	10	mailserver.mydomain.com.

mydomain.com.	IN	NS	webserver.mydomain.com.

webserver	IN	A	192.168.1.10
www		IN	A	192.168.1.10
mailserver	IN	A	192.168.1.11


... neatness counts. :D

It is *usually* good SOP to stay away from CNAME's unless you need one, it adds an extra step to the resolution.
 
Back
Top