#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    308
    Rep Power
    13

    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.

    Ping error:
    Code:
    ping: cannot resolve google.com: Host name lookup failure
    A simple PHP script test before failed thats why I tried to ping.
    PHP Code:
    <?php

    $fp 
    fopen("http://google.com/""r");
    if (!
    $fp)
        die (
    $fp);
        
    while (!
    feof($fp))
        echo 
    fgets($fp1000);
        
    fclose($fp);

    ?>
    Which gave a similar error

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

    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
    Code:
    # -- 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.
    defaultrouter="192.168.50.242"
    hostname="localhost.localdomain"
    ifconfig_fxp0="inet 192.168.50.204  netmask 255.255.255.0"
    inetd_enable="YES"
    linux_enable="YES"
    moused_enable="YES"
    moused_port="/dev/psm0"
    moused_type="auto"
    sshd_enable="YES"
    usbd_enable="YES"
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    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.

    HTH,
    M.
  4. #3
  5. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    To be precise, edit /etc/resolv.conf (or create it, if it doesn't exist) and add a line like this:
    nameserver 12.34.56.78

    Here 12.34.56.78 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
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    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

    M.

IMN logo majestic logo threadwatch logo seochat tools logo