Results 1 to 8 of 8

Thread: Not able to connect to internet

  1. #1
    Join Date
    Oct 2008
    Beans
    80
    Distro
    Ubuntu 12.04 Precise Pangolin

    Not able to connect to internet

    hello,
    My remote Linux server Ubuntu 12.04.3 LTS, is not able to fetch updates.
    upon trying to
    Code:
    ping google.com
    "unknown host google.com" message.
    & update command
    Code:
    sudo apt-get update
    gives "Failed to fetch http://in.archive.ubunt..." errors.
    The server is not able to connect to the internet, thus the squid3 proxy service is also not working.

    However, if I try to ping some IP address, it shows success.
    e.g ping 8.8.8.8
    or some random website ping 106.186.118.159
    show ping reports properly.

    How to resolve & troubleshoot the issue?

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,782
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Not able to connect to internet

    Hi johnycage.

    Could you post the results of this commands?
    Code:
    ifconfig
    
    route -n
    
    nm-tool
    
    cat /etc/resolv.conf
    
    ls -l /etc/resolv.conf
    Regards.

  3. #3
    Join Date
    Oct 2008
    Beans
    80
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Not able to connect to internet

    Sorry, I should have posted this in 1st post.
    Code:
    ifconfig
    eth0 Link encap:Ethernet HWaddr 00:1b:fc:ac:6f:2c
    inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::21b:fcff:feac:6f2c/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:2190 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1260 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:483135 (483.1 KB) TX bytes:493047 (493.0 KB)
    Interrupt:43 Base address:0xe000

    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:904 errors:0 dropped:0 overruns:0 frame:0
    TX packets:904 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:72966 (72.9 KB) TX bytes:72966 (72.9 KB)
    Code:
    route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 eth0
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    I do not have network-manager installed. So nm-tool cannot be run.
    Code:
    cat /etc/resolv.conf
    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
    # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
    Code:
     ls -l /etc/resolv.conf
    lrwxrwxrwx 1 root root 29 Jun 18 21:48 /etc/resolv.conf -> ../run/resolvconf/resolv.conf

  4. #4
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,782
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Not able to connect to internet

    Thanks.
    Quote Originally Posted by johnycage View Post
    I do not have network-manager installed.
    Ohh, I see.

    The reason you are not able to resolve addresses is because you don't have a name server set on your /etc/resolv.conf. We have to figure out why this is happening.

    Did you set a static IP, or you using DHCP?

    Could you post the results of these commands?
    Code:
    cat /etc/network/interfaces
    
    cat $(find /etc/dhcp* -name dhclient.conf)
    Regards.

  5. #5
    Join Date
    Oct 2008
    Beans
    80
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Not able to connect to internet

    Yes, I've set a static IP.

  6. #6
    Join Date
    Oct 2008
    Beans
    80
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Not able to connect to internet

    Code:
    cat /etc/network/interfaces
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    auto eth0
    iface eth0 inet static
    address 192.168.1.2
    netmask 255.255.255.0
    network 192.168.1.1
    gateway 192.168.1.1
    Code:
    cat $(find /etc/dhcp* -name dhclient.conf)
    # Configuration file for /sbin/dhclient, which is included in Debian's
    # dhcp3-client package.
    #
    # This is a sample configuration file for dhclient. See dhclient.conf's
    # man page for more information about the syntax of this file
    # and a more comprehensive list of the parameters understood by
    # dhclient.
    #
    # Normally, if the DHCP server provides reasonable information and does
    # not leave anything out (like the domain name, for example), then
    # few changes must be made to this file, if any.
    #

    option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

    send host-name "<hostname>";
    #send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
    #send dhcp-lease-time 3600;
    #supersede domain-name "fugue.com home.vix.com";
    #prepend domain-name-servers 127.0.0.1;
    request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers,
    dhcp6.domain-search, dhcp6.fqdn,
    dhcp6.name-servers, dhcp6.sntp-servers;
    #require subnet-mask, domain-name-servers;
    #timeout 60;
    #retry 60;
    #reboot 10;
    #select-timeout 5;
    #initial-interval 2;
    #script "/etc/dhcp3/dhclient-script";
    #media "-link0 -link1 -link2", "link0 link1";
    #reject 192.33.137.209;

    #alias {
    # interface "eth0";
    # fixed-address 192.5.5.213;
    # option subnet-mask 255.255.255.255;
    #}

    #lease {
    # interface "eth0";
    # fixed-address 192.33.137.200;
    # medium "link0 link1";
    # option host-name "andare.swiftmedia.com";
    # option subnet-mask 255.255.255.0;
    # option broadcast-address 192.33.137.255;
    # option routers 192.33.137.250;
    # option domain-name-servers 127.0.0.1;
    # renew 2 2000/1/12 00:00:01;
    # rebind 2 2000/1/12 00:00:01;
    # expire 2 2000/1/12 00:00:01;
    #}

  7. #7
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,782
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Not able to connect to internet

    Thanks.

    You just need to add a nameserver line to your /etc/network/interfaces so it looks something like this:
    Code:
    #...
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    
    iface eth0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        network 192.168.1.1
        gateway 192.168.1.1
        dns-nameservers 192.168.1.1
    Replace 192.168.1.1 with another address if your router does not work as DNS. For instance OpenDNS' 208.67.222.222, or Google's 8.8.8.8

    Finally, restart the networking stack to take effect:
    Code:
    sudo service networking restart
    Hope it helps. Let us know how it goes.
    Regards.

  8. #8
    Join Date
    Oct 2008
    Beans
    80
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Not able to connect to internet

    Got it! Issue resolved. Thank you.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •