LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-06-2011, 09:15 AM   #1
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Rep: Reputation: 17
wget returns "HTTP 200 OK" for bad symbolic address


If I issue a 'wget' command to a symbolic IP address that is know to be bad, I am getting a HTTP return code of 200:

# wget obviousbogus.com
--2011-10-06 10:02:07-- http://obviousbogus.com/
Resolving obviousbogus.com... 92.242.140.30
Connecting to obviousbogus.com|92.242.140.30|:80... connected.
HTTP request sent, awaiting response... 200 OK

If I enter a numeric IP, this does not happen--wget fails and times out.

The same thing is happening inside one of my applications. To check the validity of a URL, I do an open of TCP port 80 and find that bad URLs are marked as valid. (The app is in MUMPS, which is probably not familiar to most people on this list.)

I would blame the DNS nameserver, but on Windows, using the same nameserver, the application works correctly.

I can probably figure out how to work around this, but if anybody has any understanding of why this might be happening on Linux and not Windows, I would appreciate the insight.

My OS is RHEL 5.6.

Thanks,
Sanford Stein
CyberTools Inc.
 
Old 10-06-2011, 11:46 AM   #2
16pide
Member
 
Registered: Jan 2010
Posts: 418

Rep: Reputation: 83
I bet obviousbogus.com is in your /etc/hosts file

please give us the output of to narrow down on the problem:
Code:
grep hosts /etc/nsswitch.conf
cat /etc/resolv.conf
nslookup obviousbogus.com
grep obviousbogus /etc/hosts
 
Old 10-06-2011, 12:38 PM   #3
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
16pide,

Output that you requested follows:
-----------------------------------------------------------------------------------------------
[root@maple mbp5vdrzqtui]# grep hosts /etc/nsswitch.conf
#hosts: db files nisplus nis dns
hosts: files dns
[root@maple mbp5vdrzqtui]# cat /etc/resolv.conf
search cybertoolsforlibraries.com
nameserver ns1.net1plus.com
nameserver ns2.net1plus.com
nameserver ns3.net1plus.com
nameserver 198.6.1.5
#nameserver 207.77.56.2
#nameserver 140.186.94.18
#nameserver 207.77.56.10
#nameserver 66.205.85.4
#nameserver 66.205.86.4
[root@maple mbp5vdrzqtui]# nslookup obviousbogus.com
Server: 198.6.1.5
Address: 198.6.1.5#53

Non-authoritative answer:
Name: obviousbogus.com
Address: 92.242.140.30

[root@maple mbp5vdrzqtui]# grep obviousbogus /etc/hosts
[root@maple mbp5vdrzqtui]# nslookup anotherobviousbogus.com
Server: 198.6.1.5
Address: 198.6.1.5#53

Non-authoritative answer:
Name: anotherobviousbogus.com
Address: 92.242.140.30

[root@maple mbp5vdrzqtui]#
--------------------------------------------------------------------------------------

No,obviousbogus is not in /etc/hosts, but the nslookup output is interesting. The DNS server is resolving any bad address as 92.242.140.30.
If I change the primary DNS server to 75.75.75.75 in /etc/resolv.conf, everything works properly.

So it would seem that this is a DNS and not a Linux issue, EXCEPT that if I use ns1.net1plus.com as my DNS server on Windows, it handles
bad addresses properly.

Thanks,
SS
 
Old 10-06-2011, 02:34 PM   #4
Sanford Stein
Member
 
Registered: Jun 2008
Location: Evanston, Illinois
Distribution: RHEL 6.4
Posts: 126

Original Poster
Rep: Reputation: 17
I figured this out. The 4th nameserver in my resolv.conf (198.6.1.5 or uunet.com) was choosing to resolve all bad addresses as 92.242.140.30.
When Linux could not resolve the name via the first three nameservers, it deferred to the fourth one. So if I just eliminate 198.6.1.5 from resolv.conf everything works.

And ns1.net1plus.com worked on Windows because Windows only allows you one nameserver (and then probably defaults to something they choose).
When I tried uunet on Windows, it also failed.

Makes sense. 16pide,thanks for responding.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "Insert" & "Delete" key returns "~" in a terminal. sharky Linux - General 15 04-26-2011 08:36 AM
Wicd Returns "Bad Password" brmccarty Linux - Wireless Networking 1 03-31-2011 08:33 AM
Any ideas to pass the "ERROR 400: Bad Request." of WGET? frenchn00b Programming 1 04-19-2009 11:46 AM
gethostbyname returns "no address associated with this name" if behind a proxy iamback Linux - Networking 12 08-10-2008 12:23 PM
"Deny from" IP address using http.conf (Apache 2) not blocking the IP address griffey Linux - Security 2 02-22-2008 08:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration