LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DNS will not resolve non-domain qualified names (https://www.linuxquestions.org/questions/linux-networking-3/dns-will-not-resolve-non-domain-qualified-names-247140/)

arobinson74 10-25-2004 01:07 PM

DNS will not resolve non-domain qualified names
 
Just formatted my RedHat machine and am building it as a Slack10.0 box.

I have named running and my ethernet cards are up, but having a little problem with resolving computer names if they are not qualified.

I resolv.conf set with a search:
search mydomain.net
nameserver 192.168.0.1

I have the zones and named.conf setup.

The following work:
dig localhost
dig somecomp.mydomain.net
dig mycomp.mydomain.net

The following types of queries fail:
dig somecomp
dig mycomp

Event if these (somecomp and mycomp) are defined in /etc/hosts, the dig fails. The dig fails with a "no servers could be reached"

I have 2 NIC cards on this box (eth0 and eth1). eth1 is hard-set to 192.168.0.1 and eth0 is a DHCP assigned IP (eth0 is the way out to the world and eth1 serves my network and protects it with IP tables (which by the way is not setup yet))

eth0 is not working at the moment (unplugged) until I can get this working at add my firewall settings and get iptables up and running.

All reverse lookups work fine (IP->name), it is only the name with no domain that fails.

Shouldn't dig be picking up the "nameserver" line from resolv.conf (indirectly)?

scowles 10-25-2004 01:52 PM

The "dig" command, by defualt, has never appended the domain name to a query. From the dig man pages:

Code:

      +[no]search
              Use  [do  not  use] the search list defined by the searchlist or
              domain directive in resolv.conf (if any).  The  search  list  is
              not used by default.

So...

dig +search somecomp

Edit addition:

Or you could just alias dig to include the search option:

alias dig='dig +search'
dig mycomp

arobinson74 10-25-2004 04:13 PM

Good grief. Guess I should have posted that on the newbie list.

Feeling a bit dumb at the moment...


All times are GMT -5. The time now is 08:20 PM.