# Host name look up failure



## freeze (May 28, 2017)

Hello,

After a fresh install of FreeBSD 10.3, I'm now getting the "Host name look up failure" after every reboot and as a result I have no internet access so I'm unable to move forward with the installation of Xorg; Desktop WM, etc. During boot, the OS does acquire an IP address, but when I try to ping either yahoo.com or google.com I get the error mentioned above. I suspect my /etc/hosts file may need some tweaking, but not sure exactly what to add/edit. It currently has the "127.x.x.x  localhost" but still doesnt work. Can someone paste a working /etc/hosts file so that I can mirror it and see if that does the trick. Any other solutions that you think may apply here are also welcomed. 

Thanks


----------



## freeze (May 28, 2017)

would adding "8.8.8.8  google.com" do the trick?


----------



## japoc (May 28, 2017)

Can you show the content of your /etc/rc.conf file ? And the result of the `ifconfig` command?


----------



## ShelLuser (May 28, 2017)

freeze said:


> would adding "8.8.8.8  google.com" do the trick?


FreeBSD's manualpages are actually useful, unlike other Unix-like (personal impression: "want-to-be") systems. Sorry for the sneer, but I've become weary of systemd.

When in doubt check the manualpage: `man resolv.conf` will show you all you need to know. Or this link: resolv.conf(5).

However, I do agree with comments above: normally this would have been set during installation or through a DHCP lease. Might be worth looking into that.


----------



## freeze (May 28, 2017)

Thanks for the suggestions. While I agree that dhcp should have handled all of this, for some odd reason it hasn't.

rc.conf file contents:

```
hostname="localhost"
ifconfig_re0="DHCP"
local_unbound_enable="YES"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
power_enable="YES"
```

Contents of /etc/resolv.conf

```
#nameserver. 192.168.1.254
nameserver 8.8.8.8
nameserver 127.0.0.1
options edns0
```


----------



## japoc (May 28, 2017)

Try running

`# local-unbound-setup`

You might also need a
`# service local_unbound restart`

This should configure and restart your local caching name server (local_unbound).

I'm suprised that some of the variables in your rc.conf start with an uppercase letter (Ifconfig, Local_unbound_enable). First time I see that but maybe it's allowed.


----------



## freeze (May 28, 2017)

I'm typing from my phone as I basically have the basic OS with no Internet and the output for ifconfig is too long to type but it does show "status" as being active.


----------



## japoc (May 28, 2017)

Ok, that explains the capitalized variable names, then.


----------



## freeze (May 28, 2017)

There are no uppercase variables that was me typing from my phone..all variables in lower case.

Japoc:

Your suggestion worked. I'm now able to ping google.com thank you.


----------

