Solved

wget not resolving to subdomain on different server

Posted on 2015-02-18
6
245 Views
Last Modified: 2015-02-18
I'm using wget to grab a file:

wget http://subdomain.mysite.com

I get an error:

    Resolving subdomain.mysite.com... failed: Name or service not known

wget works for reaching other sites though, so I suspect the problem is that I'm running wget  on a server that hosts my www.mysite.com, but I am trying to reach a subdomain with the same top level domain name, that's on a different server.

So it's probably looking for the subdomain on the same server...

Do you agree that is the likely problem, and is there a solution?
0
Comment
Question by:St_Aug_Beach_Bum
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 34

Expert Comment

by:ste5an
ID: 40617474
It's not wget, it's a DNS problem. What says nslookup subdomain.mysite.com  ?
0
 
LVL 12

Expert Comment

by:Kent W
ID: 40617479
First try pining "subdomain.mysite.com".  If it's not found or the wrong IP, check your /etc/resolv.conf to see what names servers you are looking at.  
This is not a wget error, it's a straight DNS error.

Correct the DNS issues, and wget will work.
0
 

Author Comment

by:St_Aug_Beach_Bum
ID: 40617538
Ok, with nslookup I get:

# nslookup mysubdomain.mysite.com                                                                                      
Server:127.0.0.1
Address:127.0.0.1#53

** server can't find mysubdomain.mysite.com: NXDOMAIN

ping says "unknown host"

That's odd, I can enter the subdomain.domain.com into my browser and reach it easily enough.
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:St_Aug_Beach_Bum
ID: 40617545
In resolve.conf I have:

nameserver 127.0.0.1
nameserver 8.8.4.4
nameserver 8.8.8.8
nameserver 209.244.0.3
0
 
LVL 12

Accepted Solution

by:
Kent W earned 500 total points
ID: 40617581
So is this subdomain loaded on a private DNS server, like an AD server, or is it in the public?
If you know the actual IP, one workaround until you get the DNS issue solved is to add it to your hosts file

Edit
/etc/hosts
and place a line in -
192.168.1.1  subdomain.mydomain.com

Of course, change the IP and subdomain to your actual IP and FQDN.

Your resolv.conf file is looking at, in order-

nameserver 127.0.0.1 - machine itself (loopback)
nameserver 8.8.4.4 - google public dns server
nameserver 8.8.8.8 - google public dns server
nameserver 209.244.0.3 - Level3 public DNS server.

If you have an internal dns server that hosts your zones for domain.com. simply add a "nameserver" line to your resolve.conf with it's IP.  I'd add at the top.
0
 

Author Closing Comment

by:St_Aug_Beach_Bum
ID: 40617601
Perfect - that does the trick :)

Now... adding that to my notes about backups so when it's time to replace this server I'll remember to do that again!

Thank you both!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question