Solved

can't dig local domains

Posted on 2004-03-30
4
466 Views
Last Modified: 2010-04-20
I can't seem to dig, or do any kind of dns queries on local domains.  If I'm in bash and I say dig domain.com I get:
; <<>> DiG 9.2.1 <<>> domain.com
;; global options:  printcmd
;; connection timed out; no servers could be reached

However, if I do it from a different machine I get the right responce.  I'm not sure what chaned, but I did mess with my /etc/hosts file a while ago.  Any help?
-ben
0
Comment
Question by:esromneb
4 Comments
 
LVL 11

Expert Comment

by:lbertacco
ID: 10721940
Make sure you have specified a DNS server for the local domains in /etc/resolv.conf e.g.
Then make sure you can actually reach that server (ping it)

0
 
LVL 20

Expert Comment

by:Gns
ID: 10722493
Also check that you allow dns from local to local (so to speak:-) ... in your local firewall (if any).

-- Glenn
0
 
LVL 2

Accepted Solution

by:
tcmv earned 20 total points
ID: 10725070
Your /etc/resolv.conf should have entries like this, with at least one nameserver directive pointing to an IP address.  

nameserver 192.168.1.1
nameserver ns1.domain.com

If it points to a dns name only, how will it be able to resolve it to talk to the dns server to resolve other names, unless you specified it in the /etc hosts file?

/etc/hosts could look like this:
192.168.1.2     ns1.domain.com

You could use nmap to make sure your box can talk to the dns server like this:

nmap -v -sU -p53 ns1.domain.com  -- this one for UDP
nmap -v -p53 ns1.domain.com        -- this one for TCP

If it can't talk to that dns server, then look into firewall policies and routing policies  (locally on your linux box ... iptables, /sbin/route )


Hope that helps,
-tcmv
www.mvix.net
0
 

Author Comment

by:esromneb
ID: 10728057
I acually got it to work with an odd configuration of my /etc/hosts file, but I think my hosts file is right the way it is now.  I took tcmv's advice and chaned my /etc/resolf.conf file to:
nameserver 127.0.0.1
nameserver x.x.x.x

(that way it will check the local machine first, dns caching or something)  And now it works.  Thanks.
-ben
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
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 …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

747 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

13 Experts available now in Live!

Get 1:1 Help Now