Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

wget not resolving to subdomain on different server

Posted on 2015-02-18
6
Medium Priority
?
273 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 36

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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month6 days, 8 hours left to enroll

783 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