# ping: unknown host eric.hostbsd.com



## ericbsd (Feb 12, 2012)

When I ping in my server it works.

```
ping -c4 eric.hostbsd.com
PING eric (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.028 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.018 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.019 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.012 ms

--- eric ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.012/0.019/0.028/0.006 ms
```

When I ping from a pc in the same network.

```
ping -c4 eric.hostbsd.com
ping: unknown host eric.hostbsd.com
```


```
cat /etc/rc.conf
hostname="eric.hostbsd.com"
ifconfig_nfe0="dhcp inet 192.168.2.14 netmask 255.255.255.0"
defaultroute="192.168.2.1" 

sshd_enable="YES"

# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
apache22_enable="YES"
apache22ssl_enable="YES"
accf_http_ready="YES"
```


```
cat /etc/hosts
# $FreeBSD: release/9.0.0/etc/hosts 109997 2003-01-28 21:29:23Z dbaker $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file.  Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1	                eric eric.hostbsd.com
127.0.0.1		eric eric.hostbsd.com
192.168.2.14            eric eric.hostbsd.com
192.168.2.14            eric.hostbsd.com
#
# Imaginary network.
#10.0.0.2		myname.my.domain myname
#10.0.0.3		myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
#	10.0.0.0	-   10.255.255.255
#	172.16.0.0	-   172.31.255.255
#	192.168.0.0	-   192.168.255.255
#
# In case you want to be able to connect to the Internet, you need
# real official assigned numbers.  Do not try to invent your own network
# numbers but instead get one from your network provider (if any) or
# from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
```


```
cat /etc/resolv.conf
# Generated by resolvconf
domain hostbsd.com
nameserver 192.168.2.1
nameserver 142.167.200.39
```

I nslookup in my server.it give me that.


```
nslookup eric.hostbsd.com
Server:		192.168.2.1
Address:	192.168.2.1#53

** server can't find eric.hostbsd.com: NXDOMAIN
```


```
netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            192.168.2.1        UGS         0       53   nfe0
127.0.0.1          link#6             UH          0       58    lo0
192.168.2.0/24     link#5             U           0     1540   nfe0
192.168.2.14       link#5             UHS         0        6    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               ::1                           UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%nfe0/64                    link#5                        U          nfe0
fe80::21e:90ff:fed8:50b1%nfe0     link#5                        UHS         lo0
fe80::%lo0/64                     link#6                        U           lo0
fe80::1%lo0                       link#6                        UHS         lo0
ff01::%nfe0/32                    fe80::21e:90ff:fed8:50b1%nfe0 U          nfe0
ff01::%lo0/32                     ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%nfe0/32                    fe80::21e:90ff:fed8:50b1%nfe0 U          nfe0
ff02::%lo0/32                     ::1                           U           lo0
```

I try to figure what is wrong. But I'm out of resources.


----------



## T-Daemon (Feb 12, 2012)

ericturgeon said:
			
		

> ```
> cat /etc/rc.conf
> hostname="eric.hostbsd.com"
> ifconfig_nfe0="[highlight]dhcp[/highlight] inet 192.168.2.14 netmask 255.255.255.0"
> ...



If you want a static IP you shouldn't put dhcp.


----------



## ericbsd (Feb 12, 2012)

OK that something I forgot but doesn't help for my ping problem.


----------



## kpa (Feb 12, 2012)

You need to have a DNS resolver at 192.168.2.1 that is aware of your host names, if it's another BSD box then you could use something like dns/dnsmasq.


----------



## phoenix (Feb 12, 2012)

Either set up a DNS server on your network that maps between hostnames and IPs, and back again.

Or, create an /etc/hosts file that lists every hostname with its IP. and then copy that file to every single computer on the network.

The second option is much simpler to configure initially, but it becomes a pain to keep all those hosts files in sync down the road.  configuring a DNS server properly takes more effort up front, but is much simpler to maintain.


----------



## ericbsd (Feb 12, 2012)

OK now I understood! Thanks. Now I have an issue that you maybe can't help with. But I try to have my server visible out of my network and I can't. My provider won't tell me how to do it. I maybe need to build a router for gateway.


----------



## throAU (Feb 13, 2012)

If you don't know about DNS yet, you'll need to learn what you need to ask your provider for.  I'd suggest starting here.

You'll need DNS set up for your domain, for anyone to be able to reach your by hostname over the internet.


----------



## ericbsd (Feb 13, 2012)

I do know how to set a DNS. My problem is to route my IP to my server and not to my modem DSL.


----------



## White_Mad_Hatter (Feb 13, 2012)

All I see from the snippets that you provided is little snippets of information. The IP address I have gathered 192.168.2.14. What is the IP address of your workstation?  From the information that is provided there is a lot of assumptions that could be made.   The easy way is to provide a clear distinction of server and workstation. I have a couple years under my belt regarding Linux and Networking. I am new to FreeBSD but looks easy enough (side note).

1.


----------



## throAU (Feb 14, 2012)

ericturgeon said:
			
		

> I do know how to set a DNS. My problem is to route my IP to my server and not to my modem DSL.



Then why did you show that your DNS resolution is broken, and another machine "in the same network" can't ping your machine by hostname?

If it is indeed a routing issue (not clear from the snippets provided), your options:

Set up port forwarding on your modem/router?

OR - If your modem/router can act in bridge mode, plug it into the FreeBSD machine directly and use PPP on that?

Without port-forwarding, and using a dedicated device to do your DSL connection (a modem/router) you will only be able to make your machine "visible" on the internet if you get a subnet routed to you by your ISP.


----------



## fluca1978 (Feb 14, 2012)

As pointed out by others, the ping problem lies in the fact that the computer from which you generates ICMP traffic does not know how to resolve the host name, so you have either to set up a /etc/hosts entry on each machine or use an internal DNS or share a table via NIS, etc.
To make the server publicly visible you need either a static ip address, or a dynamic free address to use with something like dyndns, or port forwarding to make _some_ services of your server visible on the internet.


----------



## ericbsd (Feb 15, 2012)

About eric.hostbsd.com all is fix. My external ip only go to my DSL router with DNS configure or not. I have a bunch of option in my DSL router than I do not understand.
I have some screenshoot.


----------



## throAU (Feb 15, 2012)

Nice advertising on those image URLs (one of the URLs that popped up for me was f*cksexygirls.net).

This is not a FreeBSD problem, it is either DNS related or ISP/router related.  I'd suggest obtaining some reference material on TCP/IP and DNS, then once armed with the relevant knowledge, ask your ISP for any additional services you may need to solve your problem.


----------



## ericbsd (Feb 16, 2012)

By the way all Is fix. My router was missing a little configuration.


----------



## White_Mad_Hatter (Feb 16, 2012)

Was it DNS, DHCP not configured right? What was it? (I am wa*i*ting with a*n*xienty)


----------



## ericbsd (Feb 16, 2012)

I do not really know I open the port 53. Now all go through my sever. In my router it shows port 53 for DNS forwarding port. I never see that on the net.


----------

