A-Entry

Problems with the Linux version of XAMPP, questions, comments, and anything related.

A-Entry

Postby farukh83 » 28. August 2008 20:13

Hi,

How i can add A-Entry like this, (Dns file).

* A 127.0.0.1


Best Regards,
Farrukh Hussain
Http://www.websolpro.com
farukh83
 
Posts: 11
Joined: 28. August 2008 09:48

Postby glitzi85 » 28. August 2008 22:42

If you talk about the hosts file, that is not possible. If you really need Wildcard Entrys you have to set up a Nameserver.

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

How ?

Postby farukh83 » 28. August 2008 22:47

Hi,

Can you please tell me how i can setup name servers ? I installed named but i dont know how to configure it and what i have to type there. Please help thanks.

Best Regards,
Farrukh Hussain
farukh83
 
Posts: 11
Joined: 28. August 2008 09:48

Postby glitzi85 » 29. August 2008 09:14

I have no idea what Linux you are using, you just have to find the zone file for localhost. Under Debian it would be
Code: Select all
/etc/bind/db.local


Mine looks like this:

Code: Select all
; BIND data file for local loopback interface
;
$TTL  604800
@ IN  SOA localhost. root.localhost. (
            1   ; Serial
       604800   ; Refresh
        86400   ; Retry
      2419200   ; Expire
       604800 ) ; Negative Cache TTL
;
@ IN  NS  localhost.
@ IN  A 127.0.0.1


Just add

Code: Select all
* IN A 127.0.0.1


at the end of the file and reload named.

The try this:

Code: Select all
nslookup somethingnotconfiguredinyourhostsfile.localhost 127.0.0.1


Either it returns you the A-RR (all OK) or NXDOMAIN (you made a mistake)

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Here are my files,

Postby farukh83 » 29. August 2008 14:28

Hi,

www.b2b.com is hosted on 192.168.1.2 (web server) andother computer on LAN 192.168.1.7 is unable to open this.




httpd.conf :::::::::::::
NameVirtualHost *
NameVirtualHost 127.0.0.1:80
NameVirtualHost 127.0.0.2:80
NameVirtualHost 192.168.1.2:80

<VirtualHost 192.168.1.2:80>
ServerName b2b.com
ServerAlias www.b2b.com *.b2b.com
DocumentRoot /opt/lampp/htdocs/userinn
ServerAdmin webmaster@b2bspecial.com

</VirtualHost>





hosts file ::::::::::::::::::::::
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.2 b2b.com www.b2b.com *.b2b.com
192.168.1.2 b2b.com www.b2b.com *.b2b.com
127.0.0.1 fwta.net www.fwta.net
127.0.0.1 localhost.com www.localhost.com localhost
::1 localhost6.localdomain6 localhost6
127.0.0.1 localhost.localdomain # added by Apache Friends XAMPP



named.conf file :::::::::::

options {
listen-on port 53 { 127.0.0.1; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { localhost; };
recursion yes;
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "." IN {
type hint;
file "named.ca";
};

include "/etc/named.rfc1912.zones";









zone "." IN {
type hint;
file "/var/named/named.ca";
};




zone "b2b.com" {
type master;
file "/var/named/b2b.com.db";
};











b2b.com.db file :::::::::::::::::
@ 14440 IN SOA ns1.b2b.com. admin.b2b.com. (
2008062900
14400
7200
3600000
86400
)

b2b.com. 14400 IN NS ns1.b2b.com.
b2b.com. 14400 IN NS ns2.b2b.com.


b2b.com. 14400 IN A 192.168.1.2

localhost.b2b.com. 14400 IN A 127.0.0.1

b2b.com. 14400 IN MX 0 b2b.com.

mail 14400 IN CNAME b2.com.
www 14400 IN CNAME b2b.com.
ftp 14400 IN A 192.168.1.2

cpanel 14400 IN CNAME b2b.com.
webmail 14400 IN CNAME b2b.com.

* 14400 IN A 192.168.1.2







named.localhost File :::::::::::::::::::
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
@ IN A 127.0.0.1
* IN A 127.0.0.1






When i open www.b2b.com from another computer on LAN , it is not opening. So please kindly help me thanks.

Note: i want when someone open www.b2b.com on out network LAN, it will open website from 192.168.1.2 (server).
However 192.168.1.2 is webserver, and here www.b2b.com is opening fine.


I will be very thankful to you.

Best Regards,
Farrukh Hussain
farukh83
 
Posts: 11
Joined: 28. August 2008 09:48

ERROR

Postby farukh83 » 29. August 2008 14:48

[root@b2b ~]# /etc/init.d/named restart
Stopping named: [ OK ]
Starting named: [ OK ]
[root@b2b ~]#
[root@b2b ~]# nslookup somethingnotconfiguredinyourhostsfile.localhost 127.0.0.1
Server: 127.0.0.1
Address: 127.0.0.1#53

** server can't find somethingnotconfiguredinyourhostsfile.localhost: NXDOMAIN
farukh83
 
Posts: 11
Joined: 28. August 2008 09:48

Postby Nobbie » 29. August 2008 15:31

>Note: i want when someone open www.b2b.com on out network LAN, it will open website from 192.168.1.2 (server).

So forget named and bind, simply edit (again!) the /etc/hosts file on the client LAN PCs and add following line (you must do this on each PC):

192.168.1.2 www.b2b.com
Nobbie
 
Posts: 8768
Joined: 09. March 2008 13:04

Re: Here are my files,

Postby glitzi85 » 29. August 2008 17:41

farukh83 wrote:www.b2b.com is hosted on 192.168.1.2 (web server) andother computer on LAN 192.168.1.7 is unable to open this.

That's far, far away from your initial post...

Either you configure the hosts-File on every computer in your network or you use the nameserver. In this case the configuration would be more complicated as it should be in combination with the DHCP-Server (do distribute the DNS-Entry in your network config) and you would have to create own zone files and a lot of other stuff. But that should be done by somebody who knows what he is doing. In your case i would prefer the solution posted by ~Nobbie~.

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby farukh83 » 30. August 2008 11:59

Hi,

Thank you for your help. I am unable to setup all these things. So i have decided to work on 127.0.0.1 Only one computer because it is not opening from other computer. Thank you for your help :)

Best Regards,
Farrukh Hussain
farukh83
 
Posts: 11
Joined: 28. August 2008 09:48


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 6 guests