Results 1 to 5 of 5
I have a paid for domain "xtecanada.com" and a dyndns domain..I am trying to configure bind to be authorattive for bot hof these servers so I can host both web ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-27-2005 #1Just Joined!
- Join Date
- Apr 2005
- Posts
- 4
cant seem to get bind working to host viirtual server..
I have a paid for domain "xtecanada.com" and a dyndns domain..I am trying to configure bind to be authorattive for bot hof these servers so I can host both web servers by name..
here is my named.conf file:
here are my zone file's for these two domains#
################################################## ##############################
# Server Configuration
#
options {
# Set the working directory from which all relative paths are based
# For the win2k default install "C:\WINNT\system32\dns\etc"
#
directory "/var/lib/named/etc/bind";
# RECURSION - Required for caching servers
# Default: yes
# Values : yes, no
#
# yes: Attempt to resolve requests we are not authoritative for
# no : Do not resolve requests we are not authoritative for
#
recursion yes;
# ALLOW-RECURSION - Who may use our caching server?
# Default: any;
# Values : any, none, (addresslist)
#
# any : anybody may use the caching server
# none : noone may use the caching server
# address: List of IP addresses that may use the caching server.
#
allow-recursion { localhost; localnets; };
# FORWARD - Recommended for caching servers
# Default: first
# Values : first, only
#
# first: Query "forwarders" first, then resolve request ourself
# only : Only query the "forwarders" to resolve requests
#
#forward first;
# FORWARDERS - Required if "forward" is used
# Default: (no forwarding)
# Values : (addresslist)
#
# It is recommended that you use your ISP's caching server addresses
# Example: forwarders { 127.0.0.1; 127.0.0.2; }
#
#forwarders { };
# QUERY SOURCE - Useful for caching servers behind a firewall
# Default: address * port *
# Values : The IP address and port to use as the source of queries to other servers
#
#query-source address * port 53;
# NOTIFY - Relevant to authoritative servers
# Default: yes
# Values : yes, explicit, no
#
# yes : Send DNS NOTIFY messages to slave servers in zone NS records when zone changes
# explicit: Only send DNS NOTIFY messages to "also-notify" hosts
# no : Never automatically send DNS NOTIFY messages
#
notify no;
};
################################################## ##############################
# Logging Configuration
#
logging {
#
# Define channels for the two log files
#
channel query_log {
severity info;
print-time yes;
file "query.log" versions 3 size 100M;
};
channel activity_log {
severity info;
print-time yes;
print-category yes;
print-severity yes;
file "activity.log" versions 3 size 100M;
};
#
# Send the interesting messages to the appropriate channels
#
category queries { query_log; };
category default { activity_log; };
category xfer-in { activity_log; };
category xfer-out { activity_log; };
category notify { activity_log; };
category security { activity_log; };
category update { activity_log; };
#category update-security { activity_log; }; # BIND 9.3 only
#
# Dump all uninteresting messages
#
category network { null; };
category lame-servers { null; };
};
################################################## ##############################
# Zone Configuration
#
#
# Specify the root name servers
#
zone "." IN {
type hint;
file "named.ca";
};
#
#
# Configure ourself as the host for wizzardry.ath.cx
#
zone "wizzardry.ath.cx" IN {
type master;
file "wizzardry.ath.cx.zone";
};
#
# Configure ourself as the host for xtecanada.com
#
zone "xtecanada.com" IN {
type master;
file "xtecanada.com.zone";
};
#
# Reverse IP mapping for 209.197.186.60
#
zone "60.186.197.209.in-addr.arpa" {
type master;
file "209.197.186.rev";
};
$TTL 900 ; 900 seconds default record (T)ime (T)o (L)ive in cache
; wizzardry.ath.cx zone file
;
@ IN SOA ns1.wizzardry.ath.cx. ( ; ns1 is the primary server for wizzardry.ath.cx
admin ; contact email for wizzardry.ath.cx is admin@wizzardry.ath.cx
2004041700 ; Serial ID in reverse date format
21600 ; Refresh interval for slave servers
1800 ; Retry interval for slave servers
604800 ; Expire limit for cached info on slave servers
900 ) ; Minimum Cache TTL in zone records
;
NS wizzardry.ath.cx ; wizzardry.ath.cx is a host for wizzardry.ath.cx
@ MX 10 mail ; primary mail server
;
localhost A 127.0.0.1 ; localhost connection ip
@ A 209.197.186.60 ; wizzardry.ath.cx's IP address is 209.197.186.60
@ MX 10 mail ; Mail for *@wizzardry.ath.cx is sent to mail.wizzardry.ath.cx
* CNAME @when I use the dig command on wizzardry.ath.cx it comes up with this response$TTL 900 ; 900 seconds default record (T)ime (T)o (L)ive in cache
; xtecanada.com zone file
;
@ IN SOA ns1.xtecanada.com. ( ; ns1 is the primary server for xtecanada.com
admin ; contact email for xtecanada.com is admin@xtecanada.com
2004041700 ; Serial ID in reverse date format
21600 ; Refresh interval for slave servers
1800 ; Retry interval for slave servers
604800 ; Expire limit for cached info on slave servers
900 ) ; Minimum Cache TTL in zone records
;
NS xtecanada.com ; xtecanada.com is a host for xtecanada.com
@ MX 10 mail ; primary mail server
;
localhost A 127.0.0.1 ; localhost connection ip
@ A 209.197.186.60 ; xtecanada.com's IP address is 209.197.186.60
@ MX 10 mail ; Mail for *@xtecanada.com is sent to mail.xtecanada.com
* CNAME @
and dig xtecanada.com# dig wizzardry.ath.cx
; <<>> DiG 9.2.1 <<>> wizzardry.ath.cx
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17106
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;wizzardry.ath.cx. IN A
;; ANSWER SECTION:
wizzardry.ath.cx. 86400 IN A 209.197.186.60
;; Query time: 121 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Wed Apr 27 03:18:24 2005
;; MSG SIZE rcvd: 50
I always seem to get my main server page and not my virtual page regardless of which hosts I enter..what am I doing wrong..dig xtecanada.com
; <<>> DiG 9.2.1 <<>> xtecanada.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 41437
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;xtecanada.com. IN A
;; ANSWER SECTION:
xtecanada.com. 86400 IN A 216.40.33.117
;; Query time: 115 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Wed Apr 27 03:19:05 2005
;; MSG SIZE rcvd: 47
Wizzard
- 04-27-2005 #2Linux Enthusiast
- Join Date
- Feb 2005
- Location
- SE, Stockholm
- Posts
- 512
Ok, since you got the domain name to work properly, it is not a DNS issue.
The problem is in your VirtualHost configuration in your Apache config.
You should have some entries like this
Check your Apache configuration structure for entries like this,Code:# Next line identifies which IF you are VHosting # Make sure you change the IP to your internal IP!! NameVirtualHost 192.168.1.1 # Begin of the first VHost configuration # Even here you need to change the IP!! <VirtualHost 192.168.1.1:80> ServerName www1.example.com DocumentRoot /var/www/html/www1 </VirtualHost> # Begin of the second VHost configuration # Even here you need to change the IP!! <VirtualHost 192.168.1.1:80> ServerName www2.example.com DocumentRoot /var/www/html/www2 </VirtualHost> # Begin of the third VHost configuration # And here we have another Domain as well. # Even here you need to change the IP!! <VirtualHost 192.168.1.1:80> ServerName www.otherdomain.com DocumentRoot /var/www/html/otherDomain </VirtualHost>
change all values to fit your environment.
- 04-27-2005 #3Just Joined!
- Join Date
- Apr 2005
- Posts
- 4
ok thank you I thought I had configured bind9 properly and chroot'ed it..maybe was to hastefull..now the domain has been transfered succesdully to my servers..
Originally Posted by swemic
I have set up my virtual servers..here is some of the code..
the reson I have commented out the first virtual server is because I cannot seem to reach the second host again..whwn I comment out one of them the other comes alive but both do not seem to be working together..please I hope this is not a bind issue..#
# If you want to use name-based virtual hosts you need to define at
# least one IP address (and port number) for them.
#
#NameVirtualHost 12.34.56.78:80
NameVirtualHost 192.168.2.103:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
#
#<VirtualHost 192.168.2.103:80>
# ServerAdmin webmaster@wizzardry.ath.cx
# DocumentRoot /var/www
# ServerName wizzardry.ath.cx
#</VirtualHost>
<VirtualHost 192.168.2.103:80>
ServerAdmin webmaster@xtecanada.com
DocumentRoot /var/www/virtual/xtecanada.com
ServerName www.xtecanada.com
ErrorLog /var/log/apache/xtec.error.log
CustomLog /var/log/apache/xtec.access.log common
</VirtualHost>
#<VirtualHost _default_:*>
#</VirtualHost>
regards..
Wizzard
- 04-27-2005 #4Just Joined!
- Join Date
- Apr 2005
- Posts
- 4
SOLVED..
it seems like all i needed to do was incase my document root in quotes..
Document Root "/var/www/name.of.domain"
all is fine and dandy..thanks for the help swemic..
regards..
Wizzard
- 04-27-2005 #5Linux Enthusiast
- Join Date
- Feb 2005
- Location
- SE, Stockholm
- Posts
- 512
Hi,
good to hear that you got it to work.
However, I am quite confused that you needed to use the double qoutes "
AFAIK you should not need thoose, however, it works now, don't change them
Another thing you could keep in mind is that you can have a default HTML in VHost configurations to any server/host-header that you have not configured yet in your Webserver, and that would be something like this:
With this you will be able to setup an error page that you only handle named hosts at your web-server.Code:<VirtualHost *> DocumentRoot /var/www/html/Default/ </VirtualHost> <VirtualHost 192.168.1.1:80> ServerName www1.example.com DocumentRoot /var/www/html/www1 </VirtualHost>
Further on, you should set all VHOSTS in it's own sub-directory, due to security and interactions.
I.e.
www.example.com -> /var/www/html/example.com
www.another.com -> /var/www/html/another.com
In your example it will be possible to type in the browser
http://wizzardy.ath.cx/xtecanada.com and this will access your second host-header. You see, if you get a security flaw (due to some miss-configuration) in either virtual host directory structure, it will also affect the other Vhost.


Reply With Quote
