[TriLUG] Understanding why invalid hostnames and short names resolve to my home router IP

David Both dboth at millennium-technology.com
Mon Nov 3 07:07:12 EST 2014


This occurs when two configuration items are present. First, the external DNS 
service for your domain, wherever it is located, must have an A record with a 
name like *.yourdomain.com which contains the IP address of your external IP 
Address. This entry means "All other names" for your IP address.

The second configuration is that the local host /etc/resolv.conf will have an 
entry "search yourdomain.com" or "domain yourdomain.com". This may be configured 
as a DOMAIN or SEARCH entry in /etc/sysconfig/network-scripts/ifcfg-ethX.

Together they make your DNS work like this:

 1. You perform ping unreachablehost.
 2. Your host's name resolution appends the domain "yourdomain.com" to the end
    of the hostname in the ping request.
 3. Your hosts name resolver cannot find the address in /etc/hosts or other
    local DNS service so the request is sent to the external service.
 4. The external service resolves the request by returning the IP address for
    the *.yourdomain.com A record entry.

I hope this helps. You have to figure out what to do to "fix" this yourself, if 
in fact a fix is needed.



On 11/03/2014 06:03 AM, Kristopher Kane wrote:
>> So give us some more concrete examples, such as what your ping command
>> looks like, what it outputs and what dig returns for this hostname.
>
> My original example is literal:
>
>> ping unreachable-host
>   ... will resolve back to my router's IP and pong.
>
> Dig returns:
> ;unreachable-host. IN A
>
> Note there isn't an IP associated with it.
>
> This all came about while I was running some unit tests that failed when
> asserting what was expected to be an unreachable hostname in a URI class.
> No other developer experiences this and I am trying to figure out why
> invalid hostnames always resolve back to my home's DynDNS/IP.
>
> Kris
>
> -- 
>
>
> *********************************************************
> David P. Both, RHCE
> Millennium Technology Consulting LLC
> Raleigh, NC, USA
> 919-389-8678
>
> dboth at millennium-technology.com
>
> www.millennium-technology.com
> www.databook.bz - Home of the DataBook for Linux
> DataBook is a Registered Trademark of David Both
> *********************************************************
> This communication may be unlawfully collected and stored by the National
> Security Agency (NSA) in secret. The parties to this email do not consent to the
> retrieving or storing of this communication and any related metadata, as well as
> printing, copying, re-transmitting, disseminating, or otherwise using it. If you
> believe you have received this communication in error, please delete it
> immediately.
>


More information about the TriLUG mailing list