September 18th, 2005, 08:01 PM
FreeBSD can't ping beyond LAN
Im using FreeBSD as a web server which is behind a gateway. The gateway can ping the internet fine (the gateway is an XP Machine). However my freebsd cannot ping outside the LAN. I need to be able to send HTTP packets from the server to other servers on the net and cannot do so.
A simple PHP script test before failed thats why I tried to ping.
ping: cannot resolve google.com: Host name lookup failure
Which gave a similar error
$fp = fopen("http://google.com/", "r");
echo fgets($fp, 1000);
I have the default router pointing correctly to the gateway in the rc.conf file, however I require to use HTTP on a different port (6588) which is how I can browser the internet on the WinXP Client machine.
Warning: fopen(): php_network_getaddresses: getaddrinfo failed: hostname nor servname provided, or not known in /usr/home/uname/public_html/fsockopen.php on line 3
Ive searched google and the manual and tried most things that look like it might work but to no avail, perhaps Ive overlooked something as I am still new to FreeBSD.
If its to any help here is my /etc/rc.conf file
# -- sysinstall generated deltas -- # Wed Sep 7 23:38:44 2005
# Created: Wed Sep 7 23:38:44 2005
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
ifconfig_fxp0="inet 192.168.50.204 netmask 255.255.255.0"
September 19th, 2005, 01:08 AM
add 192.168.50.242 (the XP gateway's IP) as name server to /etc/resolv.conf if you aren't running a local one.
September 19th, 2005, 12:28 PM
To be precise, edit /etc/resolv.conf (or create it, if it doesn't exist) and add a line like this:
Here 184.108.40.206 is assumed to be the IP address of a nameserver. Substitute the IP address of your nameserver as needed.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
September 19th, 2005, 06:59 PM
Since the MS internet connection sharing service also provides a dns proxy, you can use the IP of the XP machine for the name server