You are not logged in.

#1 2010-11-30 15:21:37

leader
Member
Registered: 2010-01-10
Posts: 4

[Solved] Unknown Host problem, I've tried dhcp and static IP

Hello,
I installed 2010.05 Arch on my old laptop with Broadcom 440x 10/100 Integrated Controller. After I login the system, I found that I can't get access to the Internet. My laptop connects to the router with wire and it works fine in Windows XP.
I've tried dhcp and static IP, but failed to get access to Internet. When ping to www.google.com, it returns the message

ping: unknown host www.google.com

1.
I used default settings at first, means "dhcp". I tried to ping gateway, but it doesn't work. And if I type ifconfig, it results:

eth0      Link encap:Ethernet  HWaddr 00:16:36:6A:24:BD  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4450 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1077 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1627647 (1.5 Mb)  TX bytes:138034 (134.7 Kb)
          Interrupt:16 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          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)

I also tried to run dhcp manaully,

dhcpcd: version 5.2.2 starting
dhcpcd: eth0: rebinding lease of 192.168.1.105
dhcpcd: eth0: acknowledged 192.168.1.105 from 192.168.1.1
dhcpcd: eth0: checking for 192.168.1.105
dhcpcd: eth0: leased 192.168.1.105 for 7200 seconds
dhcpcd: eth0: MTU set to 576
dhcpcd: forking to background

but I couldn't ping the gateway either.

2.
I modified the /etc/conf.d/dhcpcd

DHCPCD_ARGS="-q -S 192.168.1.110"

and then I could ping the gateway, if I type ifconfig

eth0      Link encap:Ethernet  HWaddr 00:16:36:6A:24:BD
          inet addr:192.168.1.110  Bcast:192.168.1.255  Mask:255.255.255.0  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4450 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1077 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1627647 (1.5 Mb)  TX bytes:138034 (134.7 Kb)
          Interrupt:16 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          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)

3.
I also tried to modified rc.conf and resolv.conf to use static IP.But it works like method 2.
Here is my rc.conf

eth0="eth0 192.168.1.110 netmask 255.255.255.0 broadcast 192.168.1.255"
INTERFACES=(eth0)
gateway="default gw 192.168.1.1"
ROUTES=(gateway)

Any ideas for my problem? Thanks in advance.

Last edited by leader (2010-12-02 16:23:52)

Offline

#2 2010-11-30 16:47:42

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: [Solved] Unknown Host problem, I've tried dhcp and static IP

The problem is most likely in /etc/resolv.conf. This file should have a list of your DNS servers which are used to translate host names in to IP addresses.

If you're using DHCP, it should populate resolv.conf automatically. For example:

[dmartins@sirschmoopy ~]$ cat /etc/resolv.conf 
# Generated by dhcpcd from eth0
# /etc/resolv.conf.head can replace this line
nameserver 192.168.171.1
# /etc/resolv.conf.tail can replace this line

192.168.171.1 is my router's IP address and it acts as a DNS server as well.

Here's a few things to try:

ping 192.168.1.1 - This makes sure your IP config is good up to your router
ping 66.211.214.131 - (IP for archlinux.org) This makes sure your IP config to the internet is good.
ping archlinux.org - If this fails and the other two pings have passed, the problem is with DNS. Check /etc/resolv.conf, at least one nameserver should be listed.

Last edited by dmartins (2010-11-30 16:48:27)

Offline

#3 2010-12-02 16:23:12

leader
Member
Registered: 2010-01-10
Posts: 4

Re: [Solved] Unknown Host problem, I've tried dhcp and static IP

I really appreciated your help!
Now the problem is solved. In fact, I've added DNS server in resolv.conf before. What causes errors is that resolv.conf changes into blank automatically when dhcpcd is still running. So I have to kill dhcpcd first before editing resolv.conf.
Unlike dhcpcd, dhclient just works well and can get IP address using DHCP.

Offline

Board footer

Powered by FluxBB