Internet connection on Linux

This is a discussion on Internet connection on Linux within the Linux Networking forums, part of the Linux Forums category; Hi, I've got a FC7 server, running a workgroup with ~10 windows PCs. I'm sharing the internet connection ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-26-2008
CCW
 
Posts: n/a
Default Internet connection on Linux

Hi,

I've got a FC7 server, running a workgroup with ~10 windows PCs. I'm
sharing the internet connection via FC7, so my setup is:


Router (192.168.0.1) ------ (eth0) 192.168.0.2 - (eth1) 192.168.1.1
------ Windows computers (1.2 - 1.10)

All of the windows computers can use the internet fine, but my FC7
server can't! I can access websites / ping by ip address but not by
name. I've checked the dns settings, and they seem to be ok, and I'm
a bit lost as to what else to check! Any ideas what could be wrong?

Thanks,
Chris
Reply With Quote
  #2 (permalink)  
Old 04-26-2008
Jack Snodgrass
 
Posts: n/a
Default Re: Internet connection on Linux

On Sat, 26 Apr 2008 03:48:49 -0700, CCW wrote:

> Hi,
>
> I've got a FC7 server, running a workgroup with ~10 windows PCs. I'm
> sharing the internet connection via FC7, so my setup is:
>
>
> Router (192.168.0.1) ------ (eth0) 192.168.0.2 - (eth1) 192.168.1.1
> ------ Windows computers (1.2 - 1.10)
>
> All of the windows computers can use the internet fine, but my FC7
> server can't! I can access websites / ping by ip address but not by
> name. I've checked the dns settings, and they seem to be ok, and I'm a
> bit lost as to what else to check! Any ideas what could be wrong?
>
> Thanks,
> Chris


the /etc/resolv.conf file lists the DNS servers that you use to resolve
names to ip addresses. If you can ping / access via ip but not name...
your /etc/resolv.conf file is probably incorrect. It should have something
like:

search private.net
nameserver 192.168.1.1
nameserver 192.168.10.1

where private.net is your domain and the two ip addresses
are the IP Addresses of a real DNS that you can get DNS info
from. You can test it out by doing
host www.yahoo.com 192.168.1.1
( where 192.168.1.1 is the ip address of a DNS server ).. if
you get a valid response, it's ok to use that DNS Server's IP
Address in your /etc/resolv.conf file. If you don't get a valid
response... you don't want to use it...

If your FC7 box has a DNS server on it, you might want
nameserver 127.0.0.1
in your /etc/resolv.conf file... but it just depends...

jack


--
D.A.M. - Mothers Against Dyslexia

see http://www.jacksnodgrass.com for my contact info.

jack - Grapevine/Richardson
Reply With Quote
  #3 (permalink)  
Old 04-26-2008
Bit Twister
 
Posts: n/a
Default Re: Internet connection on Linux

On Sat, 26 Apr 2008 03:48:49 -0700 (PDT), CCW wrote:
> Hi,
>
> I've got a FC7 server, running a workgroup with ~10 windows PCs. I'm
> sharing the internet connection via FC7, so my setup is:


> All of the windows computers can use the internet fine, but my FC7
> server can't! I can access websites / ping by ip address but not by
> name. I've checked the dns settings, and they seem to be ok, and I'm
> a bit lost as to what else to check! Any ideas what could be wrong?


You could dump your FC7 settings and let us look at them.

-------- standard debug network problem text/script follows: ------------
dump_net.txt version 4.5


If you read http://www.catb.org/~esr/faqs/smart-questions.html
it will suggest you provide any information about your setup which might
help troubleshoot your problem. Example, Internet connection type,
(cable, adsl,,,), it's hardware, (vendor/model of the modem).
Maybe that your system is hooked to a hub/switch/router and type of
hookup, (Ethernet,usb, wireless,...), distribution, config file values,... .

We need to know about your network hardware and see your config settings.

Something does not start up, try
dmesg
and/or look through /var/log/messages for an error message.

If your problem is slow network give a URL so we can try it.

Once you get your network running, you may want to run xx one last time
and save the output file for disk crash/new installs :)

Might not hurt to save xx for one of a network debugging checklist steps.

The following ambidextrous script is for suse, mandriva, ubuntu, kubuntu
and will dump your hardware status, network settings and config files used
in network setup. We need that information to troubleshoot your problem.

If you are having to use windows to access Usenet:
Format a diskette on the windows system.


Copy the following xx.txt script into xx.txt using notepad.exe
then save xx.txt to the diskette/cd/usb stick.

To get the script results back to Windows and
none of the above hardware works, you can use http://www.fs-driver.org/

If you do not want some malware writing to linux. You can replace it
with http://www.diskinternals.com/linux-reader/ which does not
provide write access to linux.

The above assumes you have not created a FAT partition to exchange
files between OSs. If you did, copy dosa.txt to it from linux and read
it from windows.

I do recommend remove/un-installing the windows/linux file system
driver after you get the linux network up.

Makes your Windows Anti Virus scanner run much faster after removal.

Also, if logged into windows, it would be nice to include your windows
network settings. Click up a Prompt/cmd/terminal and add in contents from
ipconfig /all
when you reply with linux settings.


If using linux for Usenet access, su - root, copy script text into xx
chmod +x xx
./xx

and include a.txt (if on linux) or dosa.txt (if on windows) in your reply.
Do not attach it.

NOTE: to become root, you need to do a
su - root
not su root

For the suse, ubuntu, kubuntu users,
sudo -i
chmod +x xx
../xx

exit will exit the sudo -i command.

Do not change text formatting of the output file.
If you want to hide something like domain name, use an editor to do a global
substitution of .yourdomain.com to .invalid.com
Do not worry about showing you LAN ip addresses because
nobody is going to be able to connect to 198.162.x.x from the Internet.
You dinking with ip addresses could hide the problem or send us off on a
snipe hunt. :(

If xx is not in your home directory, you will have to provide the full
path in place of $HOME. Example:
sudo -i
chmod +x /some/where/xx
/some/where/xx



------------------ Script starts below this line ---------
#!/bin/bash
#************************************************* ************
#*
#* xx - Dump network config files and network hardware status
#*
#* Output: a.txt is the linux file
#* dosa.txt is the Windows file
#*
#************************************************* ************

_fn=a.txt
_out_fn=$PWD/$_fn
_dos_fn=$PWD/dos${_fn}
_home=$PWD

function cat_fn
{
_fn=$1
if [ -f $_fn ] ; then
_count=$(stat -c %s $_fn )
if [ $_count -gt 0 ] ; then
echo "=== cat $_fn ====" >> $_out_fn
cat $_fn >> $_out_fn
fi
fi
} # end cat_fn

function grep_fn
{
_fn=$1
if [ -e $_fn ] ; then
_count=$(stat -c %s $_fn )
if [ $_count -gt 0 ] ; then
_count=$(grep -v '^#' $_fn | wc -l)
if [ $_count -gt 0 ] ; then
echo "======== grep -v '^#' $_fn ==========" >> $_out_fn
if [ "$_fn" != "shorewall.conf" ] ; then
grep -v '^#' $_fn >> $_out_fn
else
awk 'empty{if (!/^#/) print; empty=0} /^$/{empty=1}' $_fn >> $_out_fn
fi
fi
fi
fi
} # end grep_fn

function ls_dir
{
_dr=$1
if [ -d $_dr ] ; then
echo "========= cd $_dr ; ls -al ========" >> $_out_fn
cd $_dr
ls -al >> $_out_fn
fi
} # end ls_dir

function tail_fn
{
_fn=$1
if [ -e $_fn ] ; then
echo "======== tail -18 $_fn ==========" >> $_out_fn
tail -18 $_fn >> $_out_fn
fi
} # end tail_fn

#********************************
# check if commands are in $PATH
# and if not add them to PATH
#********************************

_path=""
type ifconfig > /dev/null 2>&1
if [ $? -ne 0 ] ; then
_path="${_path}/sbin:"
fi

type cat > /dev/null 2>&1
if [ $? -ne 0 ] ; then
_path="${_path}/bin:"
fi

type id > /dev/null 2>&1
if [ $? -ne 0 ] ; then
_path="${_path}/usr/bin:"
fi

if [ -n "$_path" ] ; then
PATH=${_path}$PATH
export PATH
fi

#*****************************************
# check if root and logged in correctly
#*****************************************

_uid=$(id --user)

if [ $_uid -ne 0 ] ; then
echo " "
echo "You need to be root to run $0"
echo "Click up a terminal and do the following:"
echo " "
echo "su - root"
echo "$PWD/xx"
echo " "
echo "or "
echo " "
echo "sudo -i"
echo "$PWD/xx"
echo " "
exit 1
fi

root_flg=1

if [ -n "$LOGNAME" ] ; then
if [ "$LOGNAME" != "root" ] ; then
root_flg=0
fi
fi

if [ -n "$USER" ] ; then
if [ "$USER" != "root" ] ; then
root_flg=0
fi
fi

if [ $root_flg -eq 0 ] ; then
echo " "
echo "Guessing you did a su root"
echo "instead of a su - root"
echo "please exit/logout of this session and do the following:"
echo " "
echo "su - root"
echo "$PWD/xx"
echo " "
echo "or "
echo " "
echo "sudo -i"
echo "$PWD/xx"
echo " "
exit 1
fi


#********************************
# main code starts here
#********************************


echo "Working, output will be in $_out_fn "

date > $_out_fn
chmod 666 $_out_fn

if [ -n "$_path" ] ; then
echo "======== echo $PATH ==========" >> $_out_fn
echo "$PATH" >> $_out_fn 2>&1
fi

cat_fn /etc/product.id

for _d in /etc/*release ; do
if [ ! -d $_d ] ; then
echo "======== cat $_d ==========" >> $_out_fn
cat $_d >> $_out_fn
fi
done


echo "======== uname -rvi =============" >> $_out_fn
uname -rvi >> $_out_fn

for _d in /etc/*version ; do
if [ ! -d $_d ] ; then
echo "======== cat $_d ==========" >> $_out_fn
cat $_d >> $_out_fn
fi
done

cat_fn /proc/*version

type lsb_release > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "======== lsb_release -a ==========" >> $_out_fn
lsb_release -a >> $_out_fn 2>&1
fi

echo " " >> $_out_fn
if [ -n "$SECURE_LEVEL" ] ; then
echo "msec security level is $SECURE_LEVEL" >> $_out_fn
fi

echo "
$(grep 'model name' /proc/cpuinfo)
$(grep 'cpu MHz' /proc/cpuinfo)

" >> $_out_fn

cat_fn /etc/urpmi/urpmi.cfg

echo "======== free ==========" >> $_out_fn
free >> $_out_fn 2>&1
echo " " >> $_out_fn

if [ -e /etc/inittab ] ; then
_line=$(grep :initdefault /etc/inittab)
set -- $(IFS=':'; echo $_line)
echo " " >> $_out_fn
echo "Default run level is $2" >> $_out_fn
echo " " >> $_out_fn
fi

type chkconfig > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "======== chkconfig --list ==========" >> $_out_fn
for _serv in avahi named tmdns ; do
chkconfig --list | grep -i $_serv > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "Double check if /$_serv/ needs to be disabled on boot" >> $_out_fn
chkconfig --list | grep -i $_serv >> $_out_fn
fi
done

chkconfig --list >> $_out_fn

else
echo "======== ls -o /etc/rcS.d/ ==========" >> $_out_fn
for _serv in avahi named tmdns ; do
ls /etc/rcS.d/S* | grep $_serv > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "Double check if /$_serv/ needs to be disabled on boot" >> $_out_fn
fi
done

ls -o /etc/rcS.d >> $_out_fn
fi

_fn=/etc/nsswitch.conf
if [ -e $_fn ] ; then
echo "======== grep hosts: $_fn ==========" >> $_out_fn
grep hosts: $_fn >> $_out_fn
fi

grep_fn /etc/resolv.conf

grep_fn /etc/resolvconf/resolv.conf.d/head
cat_fn /etc/resolvconf/resolv.conf.d/base
cat_fn /etc/resolvconf/resolv.conf.d/tail


echo "======== hostname --fqdn ==========" >> $_out_fn
hostname --fqdn >> $_out_fn

cat_fn /etc/netprofile/profiles/default/files/etc/hosts
cat_fn /etc/hostname
cat_fn /etc/HOSTNAME

ls /etc/mod*.conf > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "======== grep eth /etc/mod*.conf ==========" >> $_out_fn
grep -i eth /etc/mod*.conf >> $_out_fn
fi

if [ -e /etc/modprobe.conf ] ; then
echo "======== cat /etc/modprobe.conf ==========" >> $_out_fn
cat /etc/modprobe.conf >> $_out_fn
fi

cat_fn /etc/dhclient-enter-hooks
cat_fn /etc/dhclient-exit-hooks

grep_fn /etc/host.conf

echo "================ ifconfig -a ==============" >> $_out_fn
ifconfig -a >> $_out_fn

cat_fn /etc/iftab
cat_fn /etc/udev/rules.d/61-net_config.rules

echo "============== route -n =================" >> $_out_fn
route -n >> $_out_fn

cat_fn /etc/sysconfig/network/routes

cat_fn /etc/sysconfig/network
grep_fn /etc/mkinitramfs/initramfs.conf

echo "========== head -15 /etc/hosts ===========" >> $_out_fn
head -15 /etc/hosts >> $_out_fn

cat_fn /etc/network/interfaces
cat_fn /var/run/network/ifstate
cat_fn /etc/dhclient.conf



ethtool_flg=0
type ethtool > /dev/null 2>&1
if [ $? -eq 0 ] ; then
ethtool_flg=1
fi

mii-tool_flg=0
type mii-tool > /dev/null 2>&1
if [ $? -eq 0 ] ; then
mii-tool_flg=1
fi


for nic in 0 1 2 ; do

if [ $mii-tool_flg -eq 1 ] ; then
mii-tool -v eth$nic > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "======== mii-tool -v eth$nic ==========" >> $_out_fn
mii-tool -v eth$nic >> $_out_fn
fi
fi

if [ $ethtool_flg -eq 1 ] ; then
ethtool eth$nic > /dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "======== ethtool eth$nic ==========" >> $_out_fn
ethtool eth$nic >> $_out_fn
fi
fi

echo "=== dmesg | grep eth$nic | grep -v SRC= ===" >> $_out_fn
dmesg | grep eth$nic | grep -v SRC= >> $_out_fn

echo "=== grep eth$nic /var/log/messages | tail -10 ===" >> $_out_fn
grep eth$nic /var/log/messages | tail -10 >> $_out_fn

cat_fn /etc/sysconfig/network-scripts/ifcfg-eth$nic
cat_fn /etc/sysconfig/networking/devices/ifcfg-eth$nic
cat_fn /etc/sysconfig/networking/profiles/default/ifcfg-eth$nic

ifconfig eth$nic > /dev/null 2>&1
if [ $? -eq 0 ] ; then
set $(ifconfig eth$nic | tr [A-Z] [a-z])
cat_fn /etc/sysconfig/network/ifcfg-eth-id-$5
fi

tail_fn /var/lib/dhcp/dhclient-eth${nic}.leases
tail_fn /var/lib/dhclient/dhclient-eth${nic}.leases
tail_fn /etc/dhcpc/dhcpcd-eth${nic}.info

done # end for nic in 0 1 2 ; do

_dir=/etc/NetworkManager/dispatcher.d
if [ -d $_dir ] ; then
ls_dir $_dir

for _d in "if-up.d" "if-down.d" "if-pre-up.d" "if-post-down.d" ; do
if [ -e /etc/network/${_d} ] ; then
echo "==== cd /etc/network/${_d} ; ls -al ===" >> $_out_fn
cd /etc/network/${_d}
ls -al >> $_out_fn
fi
done
fi

if [ -d /etc/sysconfig/network-scripts ] ; then
for _d in "ifdown.d" "ifup.d" ; do
if [ -e /etc/sysconfig/network-scripts/${_d} ] ; then
_cmd="cd /etc/sysconfig/network-scripts/${_d} ; ls -al "
echo "===== $_cmd ====" >> $_out_fn
cd /etc/sysconfig/network-scripts/${_d}
ls -al >> $_out_fn
fi
done
fi

ls_dir /etc/dhcp3/dhclient-exit-hooks.d
ls_dir /etc/resolvconf/update.d


if [ -d /etc/shorewall ] ; then
_count=$(chkconfig --list shorewall | grep -c :on )
if [ $_count -gt 0 ] ; then
echo "======= Shorewall settings =========" >> $_out_fn
cd /etc/shorewall
for _f in $(ls) ; do
echo "======= $_f =========" >> $_out_fn
grep_fn $_f
done
fi
fi


cd $_home

grep_fn /etc/hosts.allow
grep_fn /etc/hosts.deny
echo "==== end of config/network data dump =======" >> $_out_fn

awk '{print $0 "\r" }' $_out_fn > $_dos_fn
chmod 666 $_dos_fn


echo " "
echo "If posting via linux, post contents of $_out_fn"
echo "You might want to copy it to your account with the command"
echo "cp $_out_fn ~your_login"
echo " "
echo "If posting via windows, post contents of $_dos_fn"
echo " "
echo "If using diskette,"
echo "Copy $_dos_fn to diskette with the following commands:"
echo " "
echo "mkdir -p /floppy"
echo "mount -t auto /dev/fd0 /floppy"
echo "cp $_dos_fn /floppy"
echo "umount /floppy "
echo " "
echo "and $_dos_fn is ready for windows from diskette"
echo " "

#*********** end of dump xx.txt script *********

----------- script ends above this line ------------------------

and then copy xx.txt to the diskette.

On some linux distributions, you may need to get into the User/Group
screen, show all users, double click root, create the password, and
enable root. Root's password should never be the same as anyone else's.

To move xx.txt from diskette to the linux box, click up a linux terminal
su - root
(root's passwd)

mkdir -p /floppy
mount -t auto /dev/fd0 /floppy
tr -d '\015' < /floppy/xx.txt > xx
chmod +x xx
../xx

Back on the windows OS, you can cut/paste the a:\dosa.txt into your reply
under windows.
Do not attach it.

When you do reply, please remove/trim my response/text/script from your reply
before you add in the results/output of the script.

If you are dual booting the box, you can copy xx.txt to linux from windows.
Note: The following assumes /dev/hda1 is where windows is installed on the
first partition on the C: drive
If you have sata drive, you may have to use /dev/sda1 instead of /dev/hda1.

cat /etc/fstab to see which value will be required.
Do keep quotes used in the following:
mkdir -p /doze
mount -t auto /dev/hda1 /doze
tr -d '\015' < "/doze/wherever/you_saved/xx.txt" > xx
umount /doze


On windows you can read dosa.txt from a linux partition if you installed
windows linux file system driver from
http://uranus.it.swin.edu.au/~jn/linux/explore2fs.htm

Remember to remove/uninstall it to allow your Windows Anti Virus
scanner to run faster.
Reply With Quote
  #4 (permalink)  
Old 04-26-2008
Shadow_7
 
Posts: n/a
Default Re: Internet connection on Linux

Sound likes a DNS issue. /etc/resolv.conf should contain valid DNS
servers. Note itself is not a valid DNS entry, unless you have the
entire Root13 repository in your /etc/hosts file. You could also be
blocking port 53 for the routing machine in the firewall. Or there could
be some strange routing issue. Or maybe it's running some sort of DNS
cache program like bind, dns_masq, squid, ..... and it's not working right
for the machine that's running it.

Normally I have the opposite issue. Works fine on the router, but does
not on the clients. There was also a number of quirks in recent history.
I don't know how old FC7 is, but it doesn't seem like it's the most
recent. At least not at the rate they were versioning two years ago. You
might check some /proc/sys/net/ipv4/ settings. Like tcp_window_scaling,
ip_dynaddr, ip_forward, ?????

HTH
Reply With Quote
  #5 (permalink)  
Old 04-26-2008
CCW
 
Posts: n/a
Default Re: Internet connection on Linux

Thanks for the replies.

My /etc/resolv.conf is:

; generated by /sbin/dhclient-script
nameserver 208.67.222.222
nameserver 208.67.220.220

They are the IP addresses of Open DNS (http://www.opendns.com/).

Running
%> host www.yahoo.com 208.67.222.222

gives:

Using domain server:
Name: 208.67.222.222
Address: 208.67.222.222#53
Aliases:

www.yahoo.com is an alias for www.yahoo-ht3.akadns.net
www.yahoo-ht3.akadns.net has address 87.248.113.14

I get a similar response from 208.67.220.220

Does this provide any more info?

Thanks,
Chris
Reply With Quote
  #6 (permalink)  
Old 04-26-2008
Bit Twister
 
Posts: n/a
Default Re: Internet connection on Linux

On Sat, 26 Apr 2008 08:37:27 -0700 (PDT), CCW wrote:
> Thanks for the replies.
>
> My /etc/resolv.conf is:
>
> ; generated by /sbin/dhclient-script
> nameserver 208.67.222.222
> nameserver 208.67.220.220
>
> They are the IP addresses of Open DNS (http://www.opendns.com/).
>
> Running
> %> host www.yahoo.com 208.67.222.222
>
> gives:
>
> Using domain server:
> Name: 208.67.222.222
> Address: 208.67.222.222#53
> Aliases:
>
> www.yahoo.com is an alias for www.yahoo-ht3.akadns.net
> www.yahoo-ht3.akadns.net has address 87.248.113.14
>
> I get a similar response from 208.67.220.220
>
> Does this provide any more info?


Then if ping -c 1 87.248.113.14
works you are connected to the Internet

If ping -c 1 www.yahoo.com
works, you know dns is working and are connected to the Internet.
Reply With Quote
  #7 (permalink)  
Old 04-26-2008
Jack Snodgrass
 
Posts: n/a
Default Re: Internet connection on Linux

On Sat, 26 Apr 2008 08:37:27 -0700, CCW wrote:

> Thanks for the replies.
>
> My /etc/resolv.conf is:
>
> ; generated by /sbin/dhclient-script
> nameserver 208.67.222.222
> nameserver 208.67.220.220
>
> They are the IP addresses of Open DNS (http://www.opendns.com/).
>
> Running
> %> host www.yahoo.com 208.67.222.222
>
> gives:
>
> Using domain server:
> Name: 208.67.222.222
> Address: 208.67.222.222#53
> Aliases:
>
> www.yahoo.com is an alias for www.yahoo-ht3.akadns.net
> www.yahoo-ht3.akadns.net has address 87.248.113.14
>
> I get a similar response from 208.67.220.220
>
> Does this provide any more info?
>
> Thanks,
> Chris




.... that all looks right... you said in the original message:

"I can access websites / ping by ip address but not by name."
.... and it's not a /etc/resolv.conf issue.. then it's a strange one...

What happens when you do:
host www.yahoo.com
and not specify a name server.... in theory... it should pick one from
your /etc/resolv.conf file if it's reading it.

maybe your config is really screwed up and your not looking at your
/etc/resolv.conf file... do this:
cat /etc/nsswitch.conf | grep hosts | grep -v "#"
and see what you get. I get:
cat /etc/nsswitch.conf | grep hosts | grep -v "#"
hosts: files dns
which says to look in the /etc/hosts file and then do a dns lookup
if it's not found... what does your config show for that?

jack







--
D.A.M. - Mothers Against Dyslexia

see http://www.jacksnodgrass.com for my contact info.

jack - Grapevine/Richardson
Reply With Quote
  #8 (permalink)  
Old 04-26-2008
CCW
 
Posts: n/a
Default Re: Internet connection on Linux

I think I've found my problem; when I run

$> iptables -L

all I get is

Chain INPUT (policy ACCEPT)
target prot opt source destination


Chain FORWARD (policy ACCEPT)
target prot opt source destination


Chain OUTPUT (policy ACCEPT)
target prot opt source destination


I'm pretty sure I'm supposed to have some rules there...! Is there a
generic FC7 rules script? Any ideas why it might have been deleted, or
doesn't get used on boot up? I've never quite completely understood IP
tables, so if someone could point me in the direction of a generic
script (I've got some rules that I know work with my Samba
configuration), I'd be most grateful.

Thanks,
Chris
Reply With Quote
  #9 (permalink)  
Old 04-26-2008
Olaf Klischat
 
Posts: n/a
Default Re: Internet connection on Linux

CCW <c.c.wood@gmail.com> writes:

> I think I've found my problem; when I run
>
> $> iptables -L
>
> all I get is
>
> Chain INPUT (policy ACCEPT)
> target prot opt source destination
>
>
> Chain FORWARD (policy ACCEPT)
> target prot opt source destination
>
>
> Chain OUTPUT (policy ACCEPT)
> target prot opt source destination
>
>
> I'm pretty sure I'm supposed to have some rules there...!


Maybe, but those settings allow all traffic to pass into/out
of/through the box, so there shouldn't be a problem there.

Really, check that /etc/host.conf contains "bind" in the "order" line,
as the previous poster suggested.

As a last resort, I'd strace a ping on a name to see if it really goes
out to a DNS server, and if so, which one. E.g.:

tack:~# strace ping www.google.com 2>&1 | grep 53 | grep htons
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.142.1")}, 28) = 0
recvfrom(4, "D\36\201\200\0\1\0\5\0\0\0\0\3www\6google\3com\0\ 0\1\0"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.142.1")}, [16]) = 126
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.142.1")}, 28) = 0
recvfrom(4, "|\243\201\200\0\1\0\1\0\0\0\0\003147\003135\00285 \0032"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.142.1")}, [16]) = 80
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.142.1")}, 28) = 0
recvfrom(4, ">B\201\200\0\1\0\1\0\0\0\0\003147\003135\00285\00 3209\7"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.142.1")}, [16]) = 80
connect(4, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.142.1")}, 28) = 0

Here, 192.168.142.1 is the DNS server's IP address. The recvfrom calls
mean the server is responding. If there were only "connect" calls, it
would mean that the server is not responding. If nothing is output at
all, it doesn't even try to connect a DNS server (which should only
happen if something's misconfigured in your /etc/host.conf, or maybe
if you don't have anything in your resolv.conf, but you do).
Reply With Quote
  #10 (permalink)  
Old 04-26-2008
Bill Marcum
 
Posts: n/a
Default Re: Internet connection on Linux

On 2008-04-26, CCW <c.c.wood@gmail.com> wrote:
>
>
> Thanks for the replies.
>
> My /etc/resolv.conf is:
>
> ; generated by /sbin/dhclient-script
> nameserver 208.67.222.222
> nameserver 208.67.220.220
>
> They are the IP addresses of Open DNS (http://www.opendns.com/).
>
> Running
> %> host www.yahoo.com 208.67.222.222
>
> gives:
>
> Using domain server:
> Name: 208.67.222.222
> Address: 208.67.222.222#53
> Aliases:
>
> www.yahoo.com is an alias for www.yahoo-ht3.akadns.net
> www.yahoo-ht3.akadns.net has address 87.248.113.14
>
> I get a similar response from 208.67.220.220
>
> Does this provide any more info?
>

What are the permissions of /etc/resolv.conf? It should be readable by
all users.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:41 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0