1

I just lost about all my hair on this one:

I got

  • an ubuntu 12.04 machine on ip address 192.168.0.100, gateway 192.168.0.1
  • A router on 192.168.0.1, running a forwarding dns
  • ping 192.168.0.1 - or any ip address on the net works

but resolving doesn't work.

  • ping www.google.com

    unknown host www.google.com
    
  • route -n

    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.0.1     0.0.0.0         UG    100    0        0 eth0
    169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
    192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
    
  • ifconfig

    eth0      Link encap:Ethernet  HWaddr 22:ab:01:01:77:86
              inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
              inet6 addr: fe80::20ab:1ff:fe01:7786/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:443 errors:0 dropped:0 overruns:0 frame:0
              TX packets:426 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:34620 (34.6 KB)  TX bytes:64400 (64.4 KB)
              Interrupt:32
    
  • telnet 192.168.0.1 53

    Trying 192.168.0.1...
    telnet: Unable to connect to remote host: No route to host
    

What the heck is going on ?

Francis Martens
  • 169
  • 1
  • 7
  • Can you please copy-past the value of /etc/network/interfaces ? – DJYod Dec 21 '12 at 09:12
  • Can you ping 8.8.8.8 ? If that is the case your DNS isn't working but lowlevel TCP/IP is OK. (The telnet error may be confusing the matter here. Could be NOT indicative of the real problem.) If the ping 8.8.8.8 (Google DNS server) also gives a no route the router also most likely the culprit, but I would suspect the NAT/routing part in stead of the DNS service. – Tonny Dec 21 '12 at 09:19
  • check your /etc/resolv.conf file weather it contains nameserver's detatil or not. – user128296 Dec 21 '12 at 09:36

2 Answers2

3

Firewall on the router was blocking access to port :53 Added

-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT

Sorry for the hassle (and thanks sejo for helping out !)

Francis Martens
  • 169
  • 1
  • 7
0

edit you interfaces to make it look something like this

sudo vi /etc/network/interfaces

auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
    address 10.1.1.10
    netmask 255.255.255.0
    network 10.1.1.0
    broadcast 10.1.1.255
    gateway 10.1.1.1
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 10.1.1.100
    dns-search test.net
    dns-domain test.net

You'll most probably want to change your dns-nameserver - if you don't know what that is, just use 8.8.8.8. I would assume your IP settings are ok so no need to change them. Also update the dns-search and dns-domain and append your internal domain name. If you update your resolv.conf file, it may get over ridden when your network services restart as the resolvconf package will take what is placed in your interfaces file and put them in to your resolv.conf file. Thus the problem may reappear. Also the routers firewall may be blocking ports or not serving DNS. Which is why you could try 8.8.8.8. This will give you external DNS resolution. If internal DNS isn't working, then you need to ensure a DNS server is contactable and running. Otherwise use the /etc/hosts file.

Oli
  • 418
  • 4
  • 15