Solved

wget not resolving to subdomain on different server

Posted on 2015-02-18
6
224 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
  • 3
  • 2
6 Comments
 
LVL 33

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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

776 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