Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ubuntu 11.10

DNS works fine with nslookup and dig

sr@sr-ThinkPad-R52:~$ nslookup ocelot.rmg.local
Server:     192.168.0.100
Address:    192.168.0.100#53

Name:   ocelot.rmg.local
Address: 192.168.0.100

sr@sr-ThinkPad-R52:~$ dig ocelot.rmg.local

; <<>> DiG 9.7.3 <<>> ocelot.rmg.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7831
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;ocelot.rmg.local.      IN  A

;; ANSWER SECTION:
ocelot.rmg.local.   10800   IN  A   192.168.0.100

;; AUTHORITY SECTION:
ocelot.rmg.local.   10800   IN  NS  ocelot.rmg.local.

;; Query time: 4 msec
;; SERVER: 192.168.0.100#53(192.168.0.100)
;; WHEN: Sun Jan 15 17:14:41 2012
;; MSG SIZE  rcvd: 64

And curl can connect to hosts directly

sr@sr-ThinkPad-R52:~$ curl -I http://192.168.0.100/
HTTP/1.1 200 OK
Date: Sun, 15 Jan 2012 17:15:45 GMT
Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.3.0
Last-Modified: Sat, 25 Jul 2009 05:17:17 GMT
ETag: "31bdb-13e6-46f80d59a5140"
Accept-Ranges: bytes
Content-Length: 5094
Cache-Control: max-age=60
Expires: Sun, 15 Jan 2012 17:16:45 GMT
MS-Author-Via: DAV
X-Frame-Options: SameOrigin
Content-Type: text/html

but nothing (Firefox, Curl etc.) will let me connect to hosts via DNS

sr@sr-ThinkPad-R52:~$ curl -I http://ocelot.rmg.local/
curl: (6) Couldn't resolve host 'ocelot.rmg.local'
sr@sr-ThinkPad-R52:~$ curl -I http://google.co.uk/
curl: (6) Couldn't resolve host 'google.co.uk'

So nslookup and dig resolve domains correctly but nothing else will. First DNS works fine everywhere else on the network.

sr@sr-ThinkPad-R52:~$ sudo cat /etc/resolv.conf 
[sudo] password for sr: 
# Generated by NetworkManager
nameserver 192.168.0.100
sr@sr-ThinkPad-R52:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:41:15:f5:a9  
          inet addr:192.168.0.51  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::216:41ff:fe15:f5a9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:928 errors:0 dropped:0 overruns:0 frame:0
          TX packets:550 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:97057 (97.0 KB)  TX bytes:74362 (74.3 KB)
          Interrupt:16 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

As requested

sr@sr-ThinkPad-R52:~$ dig ipv6.google.com

; <<>> DiG 9.7.3 <<>> ipv6.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3009
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ipv6.google.com.       IN  A

;; ANSWER SECTION:
ipv6.google.com.    604308  IN  CNAME   ipv6.l.google.com.

;; Query time: 311 msec
;; SERVER: 192.168.0.100#53(192.168.0.100)
;; WHEN: Mon Jan 16 16:21:21 2012
;; MSG SIZE  rcvd: 54

sr@sr-ThinkPad-R52:~$ dig ipv6.l.google.com

; <<>> DiG 9.7.3 <<>> ipv6.l.google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57474
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ipv6.l.google.com.     IN  A

;; Query time: 124 msec
;; SERVER: 192.168.0.100#53(192.168.0.100)
;; WHEN: Mon Jan 16 16:22:00 2012
;; MSG SIZE  rcvd: 35

Not on an IPV6 network so curl wouldn't work for that anyway

share|improve this question
    
What do nslookup and dig give you for a host outside the local domain? Perhaps name server 192.168.0.100 is not resolving? – lhagemann Jan 15 '12 at 20:31
    
What permissions does /etc/resolv.conf have? (They must be 0644 - i.e. world-readable.) What name resolution methods do you have configured in /etc/nsswitch.conf, the hosts line? (It must contain dns in the list.) Does getent -s dns hosts google.com work? – grawity Jan 15 '12 at 21:48
    
@grawity -rw-r--r-- 1 root root 55 2012-01-15 17:08 /etc/resolv.conf, nsswitch: files mdns4_minimal [NOTFOUND=return] dns mdns4, getent works correctly – Smudge Jan 16 '12 at 0:09
    
@chakram88 It's in the original question, I tried curling google.com. And since .0.100 is the only DNS server on the network how else would it resolve external domains? – Smudge Jan 16 '12 at 0:10
1  
Now try AAAA queries and show people the results in your question. – JdeBP Jan 16 '12 at 13:38

Did you try any other software? Like ping, telnet, ssh?

For example, can you give the output of

strace ping google.co.uk
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .