ping: unknown host eric.hostbsd.com

ericbsd

Developer
When I ping in my server it works.
Code:
 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.
Code:
ping -c4 eric.hostbsd.com
ping: unknown host eric.hostbsd.com

Code:
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"

Code:
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.)
#

Code:
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.

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

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

Code:
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.
 
ericturgeon said:
Code:
cat /etc/rc.conf
hostname="eric.hostbsd.com"
ifconfig_nfe0="[highlight]dhcp[/highlight] inet 192.168.2.14 netmask 255.255.255.0"
defaultroute="192.168.2.1"

If you want a static IP you shouldn't put dhcp.
 
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.
 
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.
 
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.
 
I do know how to set a DNS. My problem is to route my IP to my server and not to my modem DSL.
 
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.
 
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.
 
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.
 
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.



 
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.
 
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.
 
Back
Top