test bind before moving to production
brian
a001 at yakkadesign.com
Fri Jul 4 02:29:48 UTC 2014
I can't get this to work. I'm trying to use the test url <tst.com>.
When I open it in my browser, I get a server not found error.
In /etc/resolv.conf I changed
nameserver 127.0.0.1
I set:
chattr +i /etc/resolv.conf
and rebooted and opened the file to verify that it wasn't getting
overwritten
In /etc/named.conf I added
zone "tst.com" {
type master;
file "/var/named/tst.com.zone";
};
I created the file /var/named/tst.com.zone and added:
$TTL 86400
$TTL 604800
@ IN SOA ns.example.com. root.example.com. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.example.com.
ns IN A 127.0.0.1
In /usr/local/apache/conf/httpd.conf I added:
<VirtualHost *:80>
ServerName tst.com
DocumentRoot /tmp/public_html_tst01
<Directory /tmp/public_html_tst01>
AllowOverride None
Require all denied
Options Indexes Includes FollowSymLinks
</Directory>
ErrorLog /tmp/apache_logs/error.log
</VirtualHost>
If I run:
named-checkconf /etc/named.conf
I don't get any output
If I run
named-checkzone tst.com /var/named/tst.com.zone
I get:
zone tst.com/IN: loaded serial 1
OK
I checked the apache error log and it is empty.
Brian
On 07/03/2014 10:39 AM, Jeremy C. Reed wrote:
> On Thu, 3 Jul 2014, brian wrote:
>
>> I'm new to bind. I want to be able to test the dns server on my local
>> machine before launching it by putting the domain names (ie example.com) in
>> my browser and browsing the site.
>>
>>
>> Both the dev and production machines are CentOS. I assume I'll need to edit
>> the host file to redirect to the local dns. But with this method I'm not
>> sure how it will resolve multiple domains (i.e. example.com and
>> example2.com).
> The host file (/etc/hosts I assume) won't help. You can use
> /etc/resolv.conf and have nameserver line point to your localhost for
> testing.
>
> Or use dig with the @ argument to set the address of the nameserver to
> use. For example, "dig @127.0.0.1 www.example.com". Then also try that
> from outside systems to using the @ with the network interface's
> address.
>
More information about the bind-users
mailing list