Link to home
Start Free TrialLog in
Avatar of CipherIS
CipherISFlag for United States of America

asked on

Linux - DNS Error

I created a folder (e.g. testactual.mysite.com).  It is a copy of actual.mysite.com.

I added the site to my host file and restarted the linux server.

e.g. ->  
100.0.0.1      actual.mysite.com
100.0.0.1      testactual.mysite.com

When I open a browser and type testactual.mysite.com I receive a DNS error "server DNS address could not be found."

When typing actual.mysite.com the site works as expected.

How do I resolve the DNS error?
Avatar of Dr. Klahn
Dr. Klahn

When I open a browser and type testactual.mysite.com ...

Are you doing this on the linux server system, or on some other system?
SOLUTION
Avatar of Alan
Alan
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CipherIS

ASKER

@Alan

Just checking, but your browser is getting resolution of other DNS queries (such as, for example, www.google.com) okay?
**Yes

Where did you register testactual.mysite.com?
** I just added it to the host file

Is it in your public DNS, or in a local DNS server?
** Local.  The IP is localhost

Did you create it as a new A record, or as a CNAME of actual.mysite.com?
** No

Either way, wherever you registered it, your machine is not (currently) getting that record (100.0.0.1)
**Ok.  How do I resolve?

If registered publicly, it might be that your DNS provider only updates their public servers periodically, so it might just be a timing issue.
**Still not working as of this morning
@DrKlahn

I suspect that your /etc/host.conf may not be configured properly.
** Ok

Look at the contents and confirm that there is a line which states:

order bind hosts
**Don't see this.  I see the IP of the local hosts and below that IP's with websites

Or possibly the other way around, depending on whether you want the system to try DNS resolution first, or look in /etc/hosts first.
**I added the new site to the /etc/hosts file.

Side note:  The hosts file is /etc/hosts, not /etc/host as is commonly mistyped.
@David

This is an example of what is in my hosts file
127.0.0.1   localhost
127.0.1.1   name of server

127.0.1.1   website1.com
127.0.1.1   website2.com
127.0.1.1   website3.com

127.0.1.1   testwebsite1.com
127.0.1.1   testwebsite2.com


# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Open in new window

@Arnold.

Below is what is in the nsswitch.conf file.
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

Open in new window

**Don't see this.  I see the IP of the local hosts and below that IP's with websites

That would be the /etc/hosts file, not /etc/host.conf.  Look in /etc/host.conf.  There should not be anything in there related to host addresses.  At most, /etc/host.conf contains two lines on normal systems and one of them is "order".

If "order bind hosts" is missing from /etc/host.conf, then the system defaults to DNS resolution and ignores the contents of /etc/hosts.

Check the contents of /etc/host.conf and let us know what's in there.
@DrKlahn

Looking in the /etc/host.conf file this is what is in the file.
# The "order" line is only used by old versions of the C library.
order hosts,bind
multi on

Open in new window

I looked at /etc/resolv.conf and it is empty.  

Any idea how to resolve the DNS for my new site?  When I ping the site from windows it is not found.
How do I add a DNS entry on the linux server?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Needed to add DNS entry with registrar