DNS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationDNS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old December 10th, 2003, 09:33 PM
inter2004 inter2004 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 7 inter2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Host file redirect

Hello,

I'm a first timer here so please be patient..I'm having a problem sorting out how to test our external site (Haven't assign a domain / dns yet).. What we want is to test the site located in 203.98.XX.XX using a dummy domain name www.dummytest.com.au .. I have read that to be able to use this functionality, You need to add a line in your hosts file (I'm using windows 2000 Prof) something like

203.98.XX.XX www.dummytest.com.au

In the 203.98.XX.XX box, I have already set-up apache (Name based) for www.dummytest.com.au.
But when I type the site to my browser (IE explorer), it just keep on gining a an error message "Cannot find server or DNS Error
"... Could you give me some insightes here...Thanks in advance...

Reply With Quote
  #2  
Old December 10th, 2003, 11:46 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You can't blindly create www.dummytest.com.au at 203.98.XX.XX. To test the Apache at 203.98.XX.XX simply type in http://203.98.XX.XX, it's that simple.

>> when I type the site to my browser (IE explorer)

Using IE is a dummy in the first place.

Reply With Quote
  #3  
Old December 11th, 2003, 12:31 AM
inter2004 inter2004 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 7 inter2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry, but let me know if I am wrong.. My understanding of hosts file is that if if include an info like

203.98.XX.XX www.dummytest.com.au

What will happen here is that instead of going to athe proper dns server, the browser or the "connection" will somehow go and communicate straight to whatever ip address I have specified, in this case 203.98.XX.XX. Since the domain name dummytest.com.au is set-up in that server (web server is Apacje) (203...), it should give me back the default/initial page.. We can use hosts file in this sense if we wanted to test a site that hasn't been allocated a proper domain name. Am I right??? What wrong with using the hosts file in this way??

Reply With Quote
  #4  
Old December 11th, 2003, 01:40 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
the browser or the "connection" will somehow go and communicate straight to whatever ip address I have specified

Correct

Quote:
We can use hosts file in this sense if we wanted to test a site that hasn't been allocated a proper domain name
That'd be for LOCAL testing only. You may be able to ping 203.98.XX.XX and it may resolve to www.dummytest.com.au but ON YOUR END ONLY.

Quote:
What wrong with using the hosts file in this way??
You need the same hosts file on both ends, not just your location.
If Apache at 203.98.XX.XX doesn't recognize www.dummytest.com.au as a qualified ServerName, it simply won't answer to any www request. That said, you can't blindly create www.dummytest.com.au at 203.98.XX.XX. At 203.98.XX.XX, you need to be to ping www.dummytest.com.au and make sure it solves to 203.98.XX.XX otherwise Apache just won't accept that ServerName.

Reply With Quote
  #5  
Old December 11th, 2003, 06:39 AM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,193 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 27 m 56 sec
Reputation Power: 77
It could actually be this. You are behind a router, and you're trying to connect to your public IP. This just doesn't work for many different routers. So I want you to try to LOCALLY connect to your loopback IP, your private IP, and public IP directly without using a domain name. If the private IP works but not the public IP, then you should set the domain name to your private IP in the hosts file.

If you can't connect with any of those IP's locally, then I want you to make sure apache is even listening on the port.

netstat -an | find "0.0.0.0:80"

Do the above at the console and if you get anything in response then your apache server is running.
__________________
Send me a private message if you would like me to setup your DNS for you for a price of your choosing. This is the preferred method if your DNS needs to be fixed/setup fast and you don't have the time to bounce messages back and forth on a forum. Also, check out these links:

Whois Direct | DNS Crawler | NS Trace | Compare Free DNS Hosts

Reply With Quote
  #6  
Old December 15th, 2003, 08:06 PM
inter2004 inter2004 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 7 inter2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I still don't understand the use of hosts file in this case..I tried to ping www.dummytest.com.au to our server box and it give me this message

[testman /etc]# ping www.dummytest.com.au
PING www.dummytest.com.au (203.98.XXX.XX): 56 data bytes
64 bytes from 203.98.XXX.XX: icmp_seq=0 ttl=255 time=0.1 ms
64 bytes from 203.98.XXX.XX: icmp_seq=1 ttl=255 time=0.0 ms
64 bytes from 203.98.XXX.XX: icmp_seq=2 ttl=255 time=0.0 ms

--- www.dummytest.com.au ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss

From the look of it, it seems apache does recognize the domain I have created www.dummytest.com.au.


The hosts file works when I test it locally (apache is running in my computer. In then add an entry in the hosts file Win 2K something like this 127.0.0.1 www.dummy.com).

========

With regards to the router issue, How would I know that's is the case..Do have I to initialize something so that the router would allow me to connect to the public IP (203.98.XXX.XX)..



Still when I type the site address , it still give this DNS server not found message...

Reply With Quote
  #7  
Old December 15th, 2003, 08:23 PM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,193 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 27 m 56 sec
Reputation Power: 77
I already gave you enough information to solve your problem, however, since I was not clear enough, I need detailed information so that I can step ya through it.

Q1) What is your public IP
Q2) What is the private IP apache runs on
Q3) What is your public website domain (if any)
Q4) What is your private website domain (for local testing)
Q5) Are you using Virtual Hosts in httpd.conf? If so, I want to see a copy
Q6) What is the response to >netstat -an | find "0.0.0.0:80"
Q7) What is in your hosts file

As for connecting to your public IP... It may be possible to get it to work by manipulating the router's routing table. However, this is not necessary. Connecting to your public IP is not necessary.

Reply With Quote
  #8  
Old December 15th, 2003, 11:12 PM
inter2004 inter2004 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 7 inter2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for replying..Here are the info you requested.

Q1) What is your public IP
203.98.92.141

Q2) What is the private IP apache runs on
same ip address 203.98.92.141

Q3) What is your public website domain (if any)
For this particular box, we don't have public website domain

Q4) What is your private website domain (for local testing)
For testing i'm using www.dummytest.com.au This is just for testing purposes. When the time comes to lunch this site, we will provide a meaningful name. BTW I have created www.dummytest.com.au in apache server.

Q5) Are you using Virtual Hosts in httpd.conf? If so, I want to see a copy

NameVirtualHost 203.98.92.141
:
:
<VirtualHost 203.98.92.141>
ServerName www.dummytest.com.au
ServerAdmin admin
DocumentRoot /home/sites/site2/web
RewriteEngine on
RewriteCond %{HTTP_HOST} !^203.98.92.141(:80)?$
RewriteCond %{HTTP_HOST} !^www.dummytest.com.au(:80)?$
RewriteRule ^/(.*) http://www.dummytest.com.au/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site2/users/$1/web/$3
</VirtualHost>

Q6) What is the response to >netstat -an | find "0.0.0.0:80"
I run this command in the server with this result.

[root /]# netstat -an | find "0.0.0.0:80"
find: 0.0.0.0:80: No such file or directory

Q7) What is in your hosts file
I have 2 hosts file for you to look at..

Hosts file in my test computer (Win 2000 Prof)

203.98.92.141 www.dummytest.com.au
127.0.0.1 www.site1.com.au


Hosts file in our server (Linux)

127.0.0.1 localhost
203.98.92.141 box4.bossa.net.au # main interf
203.98.92.141 www.dummytest.com.au


Hope this helps. Thanks

Reply With Quote
  #9  
Old December 15th, 2003, 11:34 PM
inter2004 inter2004 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 7 inter2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Another thing I notices is that when I changed the hosts file to something like this


123.456.789.10 www.dummytest.com.au

(123.456.789.10 is unknown here)

I get the usual page saying that

We can't find "www.dummytest.com.au"

You can try again by typing the URL in the address bar above.
Or, search the Web:
.
.
.

But using the real ip address of our server which is

203.98.92.141 www.dummytest.com.au

it gives me something like

Cannot find server or DNS Error

It seems that It can reach the server but apache can't resolve the hostname (dummytest.com.au).

Do you guys know what I mean?

Reply With Quote
  #10  
Old December 16th, 2003, 04:53 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Q7) Where is your hosts file? What's its full path and full name to this hosts file? Have you checked the checkbox to use LMHOST file at TCP/IP properties?

Q5) Why are you using vhost if www.dummytest.com.au is the only one?
Where did you get your rewrite stuffs? They are incorrect.
Why use AliasMatch and its path appears to be a non-Windows and you said you run Apache on win2k?

Reply With Quote
  #11  
Old December 16th, 2003, 07:19 AM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,193 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 27 m 56 sec
Reputation Power: 77
Yes some of your answers suggested a linux or unix box when I asked those questions thinking you were on a win2k box (that's what you said on your original post after all). I also thought you had a private network (behind a router). So are you on a windows or linux box and is there more than one and what are their purpose?

btw, if apache is indeed running on a win2k box, then I want you to execute the netstat command on that win2k box.

Reply With Quote
  #12  
Old December 16th, 2003, 07:23 PM
inter2004 inter2004 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 7 inter2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok, let me clarify again this correctly...


Main server were apache is running is in Linux box ip address is 203.98.XX.XX

My test computer is (office) is running win 2K prof.


Q7) Where is your hosts file? What's its full path and full name to this hosts file? Have you checked the checkbox to use LMHOST file at TCP/IP properties?

**answer to this question is that I' have 2 hosts file 1 for both machine (Linux and win 2k)
** Yes, I have check LMHOST file at TCP/IP properties and it is checked (ticked)


Q5) Why are you using vhost if www.dummytest.com.au is the only one?
Where did you get your rewrite stuffs? They are incorrect.
Why use AliasMatch and its path appears to be a non-Windows and you said you run Apache on win2k?

***What I have provided is just a portion of the httpd.conf..It is not the only domain that is currently set-up in the box
***Those rewrite stuff were generated by the interface (this linux box is actually a cobalt RAQ4). Same as with the AliasMatch

Reply With Quote
  #13  
Old December 16th, 2003, 09:56 PM
SilentRage's Avatar
SilentRage SilentRage is offline
DNS/BIND Guru
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2003
Location: OH, USA
Posts: 4,193 SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level)SilentRage User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 27 m 56 sec
Reputation Power: 77
Does this URL go to the right site?

http://203.98.92.141

Reply With Quote
  #14  
Old December 16th, 2003, 10:09 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
When you're done with the DNS stuffs and have Apache problems, start a new thread in Apache forum and I will fix the rewrite stuffs for you. The existing rewrite stuffs that you have were so poorly generated.

Reply With Quote
  #15  
Old December 21st, 2003, 10:59 PM
inter2004 inter2004 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 7 inter2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
===Does this URL go to the right site?

===http://203.98.92.141


..This is the main site for the server..I have added the domain www.dummytest.com.au to apache.. I have configured apache to as

NameVirtualHost 203.98.92.141

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationDNS > Host file redirect


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread </