Solved

wget not resolving to subdomain on different server

Posted on 2015-02-18
6
219 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 32

Expert Comment

by:Stefan Hoffmann
Comment Utility
It's not wget, it's a DNS problem. What says nslookup subdomain.mysite.com  ?
0
 
LVL 12

Expert Comment

by:Kent W
Comment Utility
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
Comment Utility
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:St_Aug_Beach_Bum
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
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 …
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now