# Host name lookup failure



## a59303 (May 30, 2013)

I have an issue with connecting to the internet.


```
ping google.com
     ping: cannot resolve google.com: Host name lookup failure
```

     I don't know where to start because this seems to be too simple of an issue to address.  I have skimmed through many `man` pages and examples, consequently screwing up the system more.  Ordinarily I would reinstall a system that I could not use for whatever the reason.  I am getting tired of that though so I am trying to fix it.

     So, where to start? Instead of me posting various conf files and read-outs I am hoping someone can point me to the best place to start.

Thank You,
a5'


```
uname -a 
     FreeBSD arthur 9.0-RELEASE FreeBSD 9.0-RELEASE #0:  Tue Jan 3 07:15:25 UTC 2012
     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
```

I have to change the CMOS battery,  consequently the clock keeps getting reset.​

     I fear that this might be very aggravating, that is not my intention. I truly think that I have really messed up the system and that I need some external help.  The apparent simplicity of the post is intentional.  The idea is to start with something simple rather than muddy the waters.


----------



## quintessence (May 30, 2013)

Hello,

If you have ping to some of the following IP addresses:

```
host google.com
google.com has address 173.194.39.192
google.com has address 173.194.39.193
google.com has address 173.194.39.194
google.com has address 173.194.39.195
google.com has address 173.194.39.196
google.com has address 173.194.39.197
google.com has address 173.194.39.198
google.com has address 173.194.39.199
google.com has address 173.194.39.200
google.com has address 173.194.39.201
google.com has address 173.194.39.206
```

you should check your /etc/resolv.conf.

http://www.freebsd.org/doc/en/books/handbook/configtuning-configfiles.html Section *12.11.2. Hostnames* with example what to place in the file.


----------



## wblock@ (May 30, 2013)

Please post your /etc/rc.conf to show whether you have a static IP address or are using DHCP.  If static, manual configuration of /etc/resolv.conf is required.  DHCP is supposed to put valid values in there, but that does not always happen.


----------



## a59303 (May 30, 2013)

@quintessence:


```
ping 173.194.39.192
PING: sendto: No route to host
PING: sendto: No route to host
```

@wblock@:

I am trying to connect via DHCP, I have talked to a tech at the ISP but they don't seem to be able to or want to help.  I would rather not copy the entire file, as I have to type it all. I hope this is the relevant sections.

/etc/rc.conf


```
#######################################################################
############# Network configuration sub-section ######################
#######################################################################


### Basic network and firewall security options: ###
hostname= "arthur"            #Set this!
hostid_enable="YES"                  #Set host UUID.
hostid_file="/etc/hostid"            #file with hostuuid.
nisdomainname="NO"                   # Set to NIS domain if using NIS (or NO).
dhclient_program="/sbin/dhclient"    # Path to dhcp client program.
dhclient_flags=""                    # Extra flags to pass to dhcp client.
#dhclient_flags_fxp0=""              # Extra dhclient flags for fxp0 only
background_dhclient="NO"             # Start dhcp client in the background.
#background_dhclient_fxp0="YES"      # Start dhcp client on fxp0 in the background.
synchronous_dhclient="NO"            # Start dhclient directly on configured.
                                     # interfaces during startup.
defaultroute_delay="30"              # Time to wait for a default route on a DHCP int
erface
defaultroute_carrier_delay="5"       # Time to wait fro carrier while waiting for a d
efault route.
wpa_supplicant_program="/usr/sbin/wpa_supplicant"
wpa_supplicant_flags="-s"            # Extra flags to pass to wpa_supplicant
wpa_supplicant_conf_file="/etc/wpa_supplicant.conf"
#
```


```
### Network routing options ###
defaultrouter="NO"                   # Set to default gateway (or NO).
static_arp_pairs=""                  # Set to static ARP list (or leave empty).
static_ndp_pairs=""                  # Set to static NDP list (or leave empty).
static_routes=""                     # Set to static route list (or leave empty).
natm_static_routes=""                # Set to static route list for NATM (or leave em
pty).
gateway_enable="NO"                  # Set to YES if this host will be a gateway.
routed_enable="NO"                   # Set to Yes to enable a routing daemon.
routed_program="/sbin/routed"        # Name of routing daemon to use if enabled.
routed_Flags="-q"                    # Flags for routing daemon.
mrouted_enable="NO"                  # Do IPv4 multicast routing.
```

After some frustration I copied the resolv.conf from my OpenSuse machine which I am writing this on. I thought (perhaps foolishly) that the information in there was common to computers connecting to the internet.


/etc/resolv.conf

```
nameserver 24.299.54.212
nameserver 216.144.187.199
nameserver 204.186.80.229
```

Also; Possibly of interest, inet in the following is 0.0.0.0:note: the wire is now disconnected so there is 'no carrier' 



```
ifconfig rl0
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3808<VLAN_MTU,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:c0:9f:89:e8:a9
        inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (none)
        status: no carrier
```
 

Thank you,

a5'


----------



## kpa (May 30, 2013)

Looks like you copied the defaults file /etc/defaults/rc.conf to /etc/rc.conf, don't do that. You're supposed to have only the settings you want to change from the defaults in /etc/rc.conf, the defaults will be pulled automatically from /etc/defaults/rc.conf if not set in /etc/rc.conf

You have an rl0 interface but I don't see an ifconfig_rl0 line in your /etc/rc.conf?


Scratch your current /etc/rc.conf and try with only these lines in it:


```
hostname="arthur"

ifconfig_rl0="SYNCDHCP"
```


----------



## a59303 (May 30, 2013)

I changed /etc/rc.conf to /etc/rc.conf.obsolete and wrote a new /etc/rc.conf with 

```
hostname="arthur"
ifconfig_rl0="SYNCDHCP"
```
Still not getting anywhere.

```
[CMD]dhclient rl0[/CMD]
DHCPREQUEST on rl0 to 255.255.255.255 port 67
DHCPDISCOVER on rl0 to 255.255.255.255 port 67 interval 7
"
no DHCPOFFERS recieved.
Trying recorded lease 192.168.100.12
bound: renewal in 262072175 seconds.
```


```
[CMD]ping 173.194.39.192[/CMD]
PING 173.194.39.192 (173.194.39.192): 56 data bytes
ping: sendto: No route to host
"
```

Thank you,
a5'


----------



## kpa (May 30, 2013)

Reboot once and see if it works that way.


----------



## a59303 (May 30, 2013)

@kpa: That*'*s after a reboot.

Thanks,

a5'


----------



## kpa (May 31, 2013)

> ```
> no DHCPOFFERS received.
> ```



This means that dhclient(8) is not getting any replies to DHCP requests. What kind of network is on the rl0 side? Is there a router that hands out DHCP leases and is that something you can configure yourself?


----------



## a59303 (May 31, 2013)

@kpa:



> What kind of network is on the rl0 side? Is there a router that hands out DHCP leases and is that something you can configure yourself?



I'm sorry, I don't understand what you mean.

I have a broadband cable subscription, from this my computers use DHCP to connect. I have no router, there is a cable modem which connects to the cable and on the computer side, to the computer via ethernet cable. This is automated and, as I mentioned before, the techs there are not too helpful.

I was looking at the other posts here that where relevant to mine and saw the tcpdump command. This outputs something that may elucidate. Run before plugging ethernet in, so this includes initial communication.


```
[CMD]tcpdump -i rl0[/CMD]
tcpdump: WARNING: rl0: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on rl0, link type EN10MB (ETHERNET), capture size 65535 bytes
10:09:32.077584 IP 149.20.54.209.http > 70.44.113.171.44278: Flags [F.], seq 128
1863083, ack 2002474548, win 2055, options [nop,nop,TS val 3308118108 ecr 112576
71], length 0
10:09:32.383938 IP 149.20.54.209.http > 70.44.113.171.44280: Flags [F.], seq 109
7796084, ack 3514887778, win 2055, options [nop,nop,TS val 3146708910 ecr 112576
98], length 0
10:09:32.404605 IP 149.20.54.209.http > 70.44.113.171.44281: Flags [F.], seq 377
5232369, ack 15635262, win 2055, options [nop,nop,TS val 4202114897 ecr 11257703
], length 0
10:09:32.443340 IP 149.20.54.209.http > 70.44.113.171.44279: Flags [F.], seq 286
7008367, ack 1202056835, win 2055, options [nop,nop,TS val 2577825653 ecr 112576
97], length 0
10:09:33.373445 ARP, Request who-has 70.44.117.63 tell 70.44.112.1, length 46
10:09:33.610257 IP 149.20.54.209.http > 70.44.113.171.44276: Flags [F.}, seq 614
835106, ack 2165848178, win 2055, options [nop,nop,TS val 3228723503 ecr 1125783
4], length 0
10:09:35.000769 IP 204.255.24.104.imap > 70.44.113.171.33025: Flags [P.], seq 16
70902481:1670902542, ack 1231725755, win 46, options [nop,nop,TS val 848566158 e
cr 11255794], length 61
10:09:35.191154 ARP, Request who-has 10.114.41.221 tell 10.114.40.1, length 46
```

Thank you,
a5'


----------



## kpa (May 31, 2013)

a59303 said:
			
		

> @kpa:
> 
> I'm sorry, I don't understand what you mean.
> 
> I have a broadband cable subscription, from this my computers use DHCP to connect.  I have no router, there is a cable modem which connects to the cable and on the computer side, to the computer via ethernet cable.  This is automated and, as I mentioned before, the techs there are not too helpful.



You just answered my question here, you have a cable connection with a modem that "bridges" your equipment with the equipment of your ISP creating a network that looks like an ethernet network for all purposes.

Does your ISP offer any special instructions for connecting machines to their network or is it just "connect the cables"?

Edit: Always power cycle the modem when switching equipment connected to it, this is something I learned years ago when I had a cable connection.


----------



## a59303 (May 31, 2013)

kpa said:
			
		

> You just answered my question here, you have a cable connection with a modem that "bridges"your equipment with the equipment of your ISP creating a network that looks like an ethernet network for all purposes.
> 
> Does your ISP offer any special instructions for connecting machines to their network or is it just "connect the cables"?



I don't think they said _anything_ and other computers work fine.  I will check their website though.

Thank you,
a5'


----------



## a59303 (May 31, 2013)

kpa said:
			
		

> Edit: Always power cycle the modem when switching equipment connected to it, this is something I learned years ago when I had a cable connection.




I just tried that and no such luck.

a5'


----------



## wblock@ (May 31, 2013)

Compare the network configuration on one of the working computers.  Are they using DHCP?

That Realtek network card is ancient by current standards, and may need a crossover cable to connect to the modem.  If the other computers are newer, they probably have auto-crossover.


----------



## a59303 (May 31, 2013)

@wblock

I have not done any configuration for either the windows installation on this computer or the opensuse installation (workstation).  I am pretty confident they are using DHCP.

What files specifically should I check?

Unless its a new thing to more recent FreeBSD, I don't think I need a crossover cable.  I have had the same ISP for a few years and certainly have connected with the Hp Pavillion ze2000 laptop (FreeBSD).

a5'


----------



## ShelLuser (May 31, 2013)

I only want to add something here.



			
				kpa said:
			
		

> Edit: Always power cycle the modem when switching equipment connected to it, this is something I learned years ago when I had a cable connection.


Sometimes such a cycle can require more time than simply turning the modem off and then back on after a few seconds. I've seen this happening last week when I was helping a friend out; nothing worked and we had reset the modem too.

Then as a last resort I told him to turn off the modem, leave it off for an hour or so, and then turn it back on. Amazingly enough everything worked properly from there on. This particular problem also occurred after my friend had bought (and connected) a new router.


----------



## kpa (May 31, 2013)

In such cases it's usually a problem with ARP cache on the upstream router. All equipment that you connect to a network is supposed to send a "gratuitous arp" message to flush the corresponding entries in the caches of connected devices but in practice it doesn't always work as advertised.


----------



## a59303 (May 31, 2013)

Well, I am a bit burnt, but it works now.  

Thank *y*ou for all the assistance,

a5'


----------



## wblock@ (May 31, 2013)

If you could say what solved the problem, that might be useful to others who have a similar problem in the future.


----------



## a59303 (May 31, 2013)

*epilogue*

@wblock@

Unfortunately, I cannot be completely sure.  The way I get things done is sort of scatter-shot.  The mouse now does not work in blackbox (x windows), so I am still hindered.

I will put the info that I think is relevant up:

```
[CMD]ifconfig rl0[/CMD]
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 0
     options=3808<VLAN_MTU,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
     ether 00:c0:9f:89:e8:a9
     nd6 options=29,PERFOrMNUD, IFDISABLED, AUTO_LINKLOCAL>
     media: Ethernet autoselect (none)
     status: no carier
```
-currently unplugged-​

/etc/rc.conf

```
hostname="arthur"
ifconfig_rl0="UP"
```

/etc/resolv.conf

```
domain        sefg.ptd.net
nameserver    24.229.54.212
```

/etc/hosts

```
::1                    localhost localhost.sefg.ptd.net
127.0.0.1              localhost localhost.sefg.ptd.net
```

/boot/defaults/loader.conf                   <snippet>

```
###################################################################
########### Networking drivers ####################################
###################################################################

bridgestp_load="NO"               # if_bridge(4) support
miibus_load="YES"                 # miibus support, needed for some
drivers 
if_ae_load="NO"                   # Attansic/Atheros L2 Fast Ethernet

...
```


I saw mention of the man pages and checked the rl driver page, where I found that miibus was needed.  I changed that in the loader.conf to "YES".  Never had to do that before though.

Also I unplugged and plugged and cycled the modem multiple times, as well as rebooted multiple times.  I changed the date and time to the proper settings.  The computer keeps loosing the time whenever the machine looses power because of a dead CMOS battery (I think).


Thanks again,

a5'


----------



## wblock@ (May 31, 2013)

miibus(4) is part of the GENERIC kernel and does not need to be loaded.  Even if it weren't, that default would load it automatically.

rc.conf is still a problem.  It will not run dhclient(8), just enable the network card.  The machine will not get an IP address.


----------



## a59303 (May 31, 2013)

@wblock@

Might not be right, but it works. I did leave something out earlier.

/etc/rc.conf

```
hostname="arthur"
ifconfig_rl0="UP,DHCP"
# -- sysinstall generated deltas -- Sat Jun 1 11:42:12 2013
moused_enable="YES"
hostname="arthur.sefg.ptd.net"
```
Also, I am aware that I set the date wrong. Kind of messed up am I.

a5'


```
[CMD]arthur# dhclient rl0[/CMD]
DHCPREQUEST on rl0 to 255.255.255.255 port 67
DHCPACK from 10.178.192.1
bound to 70.44.62.150 -- renewal in 289031 seconds.
[CMD]arthur# ping google.com[/CMD]
PING google.com (70.125.226.224): 56 data bytes
64 bytes from 74.125.226.224: icmp_seq=0 ttl=56 time=22.926 ms
64 bytes from 74.125.226.224: icmp_seq=0 ttl=56 time=17.284 ms
^C
--- google.com ping statistics ---
2 packets transmitted, 2 packets recieved, 0.0% packet loss
round-trip min/avg/max/stddev =17.284/20.105/22.926/2.821 ms
#arthur
```


----------



## a59303 (May 31, 2013)

*story*

Reminds me of a funny story about Niels Bohr: A friend of his came to visit, and noticed a horseshoe over his door, he said, "I thought you didn't believe in that" to which Mr Bohr replied, "Someone told me that it works even if you don't believe in it."

a5'


----------

