My Linux-based Dreambox has never supported DNS properly. I used to
get around this by giving it a fixed IP and putting its own IP and
name in its hosts file, but now that I have a new router, I'd like to
get DNS with DHCP addresses working on the box.
The current precise symptoms are as follows:
From within command prompt of local W2k PC:
+ Can ping all local units by IP
+ Can ping external internet by name, for example www.bbc.co.uk
+ Can ping all local units except Dreambox by name
- Can no longer connect to shares on Dreambox
From within telnet shell on Dreambox:
+ Can ping all local units by IP
+ Can ping external internet by name, for example www.bbc.co.uk
- Can not ping local units by name
- Can not connect to shares on local units
AIUI, DNS is supplied on Linux boxes by named, but is this something
that is distro-dependant, like too many things are, or pretty much
standard? If the latter, there is no such file on the Dreambox. How
would I get hold of a suitable copy of the file for the Dreambox cpu's
instruction set?
I think the kernel version on the box is 2.6.9 (ppc) but would have to
check further to be certain.
--
=========================================================
Please always reply to ng as the email in this post's
header does not exist. Or use a contact address at:
http://www.macfh.co.uk/JavaJive/JavaJive.html
http://www.macfh.co.uk/Macfarlane/Macfarlane.html
On Sat, 12 Feb 2011 14:38:07 +0000, Java Jive <ja...@evij.com.invalid>
wrote:
>
> AIUI, DNS is supplied on Linux boxes by named
>AIUI, DNS is supplied on Linux boxes by named,
named is the DNS *server*. You're having problems with the DNS *client*
on your Dreambox. In other words, you don't need named.
What is in the files /etc/resolv.conf, /etc/hosts and
/etc/sysconfig/network on the Dreambox?
--
(\__/)
(='.'=)
(")_(")
On Sun, 13 Feb 2011 03:59:24 +0000, Mike Tomlinson
<mi...@jasper.org.uk> wrote:
> In article <q15dl61020df0b0g2...@4ax.com>, Java Jive
> <ja...@evij.com.invalid> writes
>
> >AIUI, DNS is supplied on Linux boxes by named,
>
> named is the DNS *server*. You're having problems with the DNS *client*
> on your Dreambox. In other words, you don't need named.
Yes, as you've doubtless now seen, I'd realised that by the time of my
second post, after doing more research.
> What is in the files ...
... /etc/resolv.conf (correct IP address mangled) ...
~ > cat /etc/resolv.conf
# Generated by udhcpc
nameserver xxx.xxx.xxx.xxx
... /etc/hosts ...
~ > cat /etc/hosts
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
... and /etc/sysconfig/network ...
~ > cat /etc/sysconfig/network
cat: /etc/sysconfig/network: No such file or directory
... also ...
~ > cat /etc/hostname
dreambox
~ > cat /etc/host.conf
order hosts, bind
> ... on the Dreambox?
I've been working on this further since my last post, and it's
beginning to come back to my senior memory now. Accordingly, I should
perhaps explain further that:
1) The network is brought up by a script adapted by myself from code
originally existing on the box, so that the network could be brought
up as early as possible to set the time on the box (at the time many
satellite transponders had dodgy time signals, I don't know if they
still do, probably so). It was several years ago that I did the work,
and the development files are now all tarred up as I am planning to
sell the test machine that I used for it, so I can't be sure, but I
think the code that I adapted was part of the original rcS script.
... but ...
2) I'm almost certain that the original code didn't get the DNS right
either!
... and ...
3) A particular problem seems to be that the Busybox implementation
of udhcpc ignores the hostname sent to the router when setting the
hostname on the machine.
Here are the relevant lines from my script (I can post it in its
entirety, put it up on my site, or PM you if you want to see the whole
thing):
if [ "$DHCP" != "00000000" ]
then
if [ -f /var/share/udhcpc/default.script ]
then
echo "/bin/udhcpc -fq -H $(cat $HOSTNAME)
--script=/var/share/udhcpc/default.script" >> $LOG
/bin/udhcpc -fq -H $(cat $HOSTNAME)
--script=/var/share/udhcpc/default.script 2>> $LOG >> $LOG
else
echo "/bin/udhcpc -fq -H $(cat $HOSTNAME)" >>
$LOG
/bin/udhcpc -fq -H $(cat $HOSTNAME) 2>> $LOG
>> $LOG
fi
else
# etc
fi
cat /etc/resolv.conf >> $LOG
hostname >> $LOG
I know that the correct hostname is being sent to the router, because
looking in its list of IP address given out by DHCP, the dreambox is
listed by name, whereas if I just type udhcpc at a telnet prompt, the
name field in the list is then blank. However, when I examine the log
file fragment that the above script fragment produces (correct IP
addresses mangled) ...
NETWORK = 00000001
DHCP = 00000001
/bin/udhcpc -fq -H dreambox
info, udhcpc (v0.9.9-pre) started
debug, Sending discover...
debug, Sending discover...
debug, Sending discover...
debug, Sending select for xxx.xxx.xxx.xxx ...
info, Lease of xxx.xxx.xxx.xxx obtained, lease time 259200
route: SIOC[ADD|DEL]RT: No such process
# Generated by udhcpc
nameserver xxx.xxx.xxx.xxx
dhcppc3
... you can see that despite sending the correct hostname as set by
the hostname file ...
dreambox
... to the server, udhcpc has set the actual machine hostname to ...
dhcppc3
... yet this doesn't appear to the be correct machine name either ...
C:\TEMP>ping dhcppc3
Unknown host dhcppc3.
Further, the log shows that I seem to be generating an error by not
having a default.script, but I'm not certain that the original DB
build had one either, though I have found them on other, non-standard
builds, an example of which reads as follows.
#!/bin/sh
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
case "$1" in
deconfig)
/sbin/ifconfig eth0 up
;;
renew|bound)
/sbin/ifconfig eth0 $ip netmask $subnet
if [ -n "$router" ] ; then
while /sbin/route del default ; do
:
done
for i in $router ; do
/sbin/route add default gw $i
done
fi
if [ -n "$hostname" ]; then
hostname $hostname
fi
echo "# Generated by udhcpc" > $RESOLV_CONF
if [ -n "$domain" ] ; then
echo search $domain >> $RESOLV_CONF
fi
for i in $dns ; do
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0
Can you help from this? How should I get DNS set up to work correctly
on the box? Fortunately, I've set the machine up to look for an image
on a USB stick, so I can make minor corrections as long as they don't
endanger booting the machine successfully.
NETWORK = 00000001
DHCP = 00000001
/bin/udhcpc -fq -H dreambox --script=/share/udhcpc/default.script
info, udhcpc (v0.9.9-pre) started
debug, Sending discover...
debug, Sending discover...
debug, Sending select for xxx.xxx.xxx.xxx ...
info, Lease of xxx.xxx.xxx.xxx obtained, lease time 259200
route: SIOC[ADD|DEL]RT: No such process
# Generated by udhcpc
nameserver xxx.xxx.xxx.xxx
On Sun, 13 Feb 2011 13:28:44 +0000, Java Jive <ja...@evij.com.invalid>
wrote:
>
> Further, the log shows that I seem to be generating an error by not
> having a default.script, but I'm not certain that the original DB
> build had one either, though I have found them on other, non-standard
> builds, an example of which reads as follows.
What is the subnet mask on the Dreambox?
Typically you should use 255.255.255.0
--
Michael Chare
On Sun, 13 Feb 2011 17:16:51 -0000, "Michael Chare"
<Munders...@chareDOTorg.uk> wrote:
>
> Typically you should use 255.255.255.0
--
1) Come hell or high water, udhcpc is determined to use its default
and incorrect hostname. Rrrr!
2) The net is being restarted when Enigma, the satellite receiver
program, starts:
/etc/boot.log
rcS No tabs
settime.sh First tab stop
default.script Second and third tab stops
settime.sh
==========
NETWORK = 00000001
DHCP = 00000001
/bin/udhcpc -fq -H dreambox --script=/share/udhcpc/default.script
info, udhcpc (v0.9.9-pre) started
default.script
==============
Environment ...
HOME='/'
HOSTNAME='/etc/hostname'
IFS='
'
LOG='/var/etc/boot.log'
OPTIND='1'
PATH='/tmp:/var/bin:/usr/bin:/bin:/usr/sbin:/sbin'
PPID='358'
PS1='\w
\$
'
PS2='>
'
PS4='+
'
PWD='/tmp'
RESOLV_CONF='/etc/resolv.conf'
interface='eth0'
Parameters ...
deconfig
hostname="dreambox"
/sbin/ifconfig eth0 up
debug, Sending discover...
debug, Sending discover...
debug, Sending select for xxx.xxx.xxx.xxx...
info, Lease of xxx.xxx.xxx.xxx obtained, lease time 259200
default.script
==============
Environment ...
HOME='/'
HOSTNAME='/etc/hostname'
IFS='
'
LOG='/var/etc/boot.log'
OPTIND='1'
PATH='/tmp:/var/bin:/usr/bin:/bin:/usr/sbin:/sbin'
PPID='358'
PS1='\w
\$
'
PS2='>
'
PS4='+
'
PWD='/tmp'
RESOLV_CONF='/etc/resolv.conf'
dhcptype='5'
dns='xxx.xxx.xxx.xxx'
domain=''
hostname='dhcppc3'
interface='eth0'
ip='xxx.xxx.xxx.xxx'
lease='259200'
mask='24'
router='xxx.xxx.xxx.xxx'
serverid='xxx.xxx.xxx.xxx'
siaddr='xxx.xxx.xxx.xxx'
sname='yyyyyyyyy'
subnet='255.255.255.0'
Parameters ...
bound
hostname="dreambox"
/sbin/ifconfig eth0 xxx.xxx.xxx.xxx netmask 255.255.255.0
/sbin/route del default
route: SIOC[ADD|DEL]RT: No such process
/sbin/route add default gw xxx.xxx.xxx.xxx
hostname dreambox
Writing /etc/resolv.conf ...
nameserver xxx.xxx.xxx.xxx >> /etc/resolv.conf
/etc/resolv.conf file ...
# Generated by udhcpc
nameserver xxx.xxx.xxx.xxx
Host name ...
dreambox
/sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
xxx.xxx.xxx.xxx * 255.255.255.0 U 0 0 0
eth0
default xxx.xxx.xxx.xxx 0.0.0.0 UG 0 0 0
eth0
/sbin/inetd &
/sbin/rdate -s ntp.pool.org
rdate: timeout connecting to time server
Sun Feb 13 19:42:00 GMT 2011
20 03 * * * rdate -s $(cat /etc/timeserver)
crond -b -L /var/etc/boot.log
crond 2.3.2 dillon, started, log level 8
Run init script ...
Starting Enigma ...
default.script
==============
Environment ...
HOME='/'
HOSTNAME='/etc/hostname'
IFS='
'
LOG='/var/etc/boot.log'
OPTIND='1'
PATH='/tmp:/var/bin:/usr/bin:/bin:/usr/sbin:/sbin'
PPID='498'
PS1='\w
\$
'
PS2='>
'
PS4='+
'
PWD='/tmp'
RESOLV_CONF='/etc/resolv.conf'
interface='eth0'
Parameters ...
deconfig
hostname="dreambox"
/sbin/ifconfig eth0 up
default.script
==============
Environment ...
HOME='/'
HOSTNAME='/etc/hostname'
IFS='
'
LOG='/var/etc/boot.log'
OPTIND='1'
PATH='/tmp:/var/bin:/usr/bin:/bin:/usr/sbin:/sbin'
PPID='498'
PS1='\w
\$
'
PS2='>
'
PS4='+
'
PWD='/tmp'
RESOLV_CONF='/etc/resolv.conf'
dhcptype='5'
dns='xxx.xxx.xxx.xxx'
domain=''
hostname='dhcppc3'
interface='eth0'
ip='xxx.xxx.xxx.xxx'
lease='259200'
mask='24'
router='xxx.xxx.xxx.xxx'
serverid='xxx.xxx.xxx.xxx'
siaddr='xxx.xxx.xxx.xxx'
sname='yyyyyyyyy'
subnet='255.255.255.0'
Parameters ...
bound
hostname="dreambox"
/sbin/ifconfig eth0 xxx.xxx.xxx.xxx netmask 255.255.255.0
/sbin/route del default
/sbin/route del default
/sbin/route add default gw xxx.xxx.xxx.xxx
hostname dreambox
Writing /etc/resolv.conf ...
nameserver xxx.xxx.xxx.xxx >> /etc/resolv.conf
Are you running Samba on the Dreambox and do you have your local workgroup
name set correctly in the Samba configuration.
--
Michael Chare
The main thing that has changed, the only significant thing, is a
change in router, which has led to a different DHCP address range, and
changing the Dreambox via its configuration menu to accept a the
router's DHCP IP rather than use the old fixed one from the range of
the previous router.
IP itself is working, because otherwise I wouldn't be able to ping and
telnet into the machine. But everything that uses LAN names, DNS or
Samba/NetBIOS, fails.
On Sun, 13 Feb 2011 19:54:02 -0000, "Michael Chare"
<Munders...@chareDOTorg.uk> wrote:
>
> Are you running Samba on the Dreambox and do you have your local workgroup
> name set correctly in the Samba configuration.
--
<snip lots>
> hostname="dreambox"
> /sbin/ifconfig eth0 xxx.xxx.xxx.xxx netmask 255.255.255.0
> /sbin/route del default
> /sbin/route del default
> /sbin/route add default gw xxx.xxx.xxx.xxx
> hostname dreambox
> Writing /etc/resolv.conf ...
> nameserver xxx.xxx.xxx.xxx>> /etc/resolv.conf
Is bind running on this box?
What does dig www.google.com return?
(just a guess, I'm one of the clueless...)
--
Adrian C
~ > bind --help
-sh: bind: not found
> What does dig www.google.com return?
~ > dig --help
-sh: dig: not found
... but, as previously reported, ...
~ > ping www.google.com
PING www.l.google.com (74.125.230.114): 56 data bytes
64 bytes from 74.125.230.114: icmp_seq=0 ttl=57 time=35.0 ms
64 bytes from 74.125.230.114: icmp_seq=1 ttl=57 time=36.8 ms
64 bytes from 74.125.230.114: icmp_seq=2 ttl=57 time=32.0 ms
64 bytes from 74.125.230.114: icmp_seq=3 ttl=57 time=31.2 ms
64 bytes from 74.125.230.114: icmp_seq=4 ttl=57 time=37.2 ms
--- www.l.google.com ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 31.2/34.4/37.2 ms
Everything on the WAN side of the router seems to have proper DNS
support.
Most of the Dreambox's Linux functionality is provided by a single
executable called BusyBox. Details of v1.18.3 can be found here (the
version on the Dreambox is older than this, v1.00):
http://www.busybox.net/downloads/BusyBox.html
~ > busybox --help
BusyBox v1.00 (2005.02.11-15:27+0000) multi-call binary
Usage: busybox [function] [arguments]...
or: [function] [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use, and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
[, adjtimex, ash, basename, bunzip2, busybox, bzcat, cat, chgrp,
chmod, chown, chroot, clear, cmp, cp, crond, crontab, cut, date,
dd, df, dirname, dmesg, dos2unix, du, echo, egrep, env, expr,
false, find, free, getty, grep, gunzip, gzip, halt, hdparm, head,
hostname, id, ifconfig, inetd, init, insmod, kill, killall, klogd,
ln, loadkmap, logger, login, losetup, ls, lsmod, md5sum, mkdir,
mknod, mkswap, modprobe, more, mount, mv, nc, netstat, nslookup,
passwd, pidof, ping, poweroff, printf, ps, pwd, rdate, reboot,
reset, rm, rmdir, rmmod, route, sed, sh, sleep, sort, strings,
su, swapoff, swapon, sync, syslogd, tail, tar, tee, telnet, telnetd,
test, time, top, touch, tr, traceroute, true, tty, udhcpc, umount,
uname, uniq, unix2dos, uptime, vi, wc, wget, which, whoami, xargs,
yes, zcat
Er, oops, sorry. I can't read.... Should retire to bed now, or just
retire.... ;-)
> + Can ping external internet by name, for example www.bbc.co.uk
OK, for your local DNS queries, does adding .lan to the end of the
hostname of each pinged unit do anything?
--
Adrian C
On Sun, 13 Feb 2011 22:09:49 +0000, Adrian C <em...@here.invalid>
wrote:
>
> OK, for your local DNS queries, does adding .lan to the end of the
> hostname of each pinged unit do anything?
--
BusyBox udhcpc seems to be in the clear.
The name dhcppc3 is actually coming from the router. If I attach the
Dreambox to my old router as the only device, the name that comes back
is dhcppc0, and the 3 version on the new router is exactly consistent
with the fact that there are three other machines that were connected
to the new router and booted up before the Dreambox.
So what happens if I forego all attempts to force, in the
initialisation files, the hostname to what I want it to be, and just
accept and set the name that comes back from the router? Can I then
at least use that? Damn it, no! I still get:
C:\TEMP>ping dhcppc3
Unknown host dhcppc3.
C:\TEMP>ping dhcppc3.
Unknown host dhcppc3..
C:\TEMP>ping dhcppc3.lan
Unknown host dhcppc3.lan.
Getting exasperated, I tried telnetting into the router and pinging
everything else both by NETBIOS and dhcppcN names. Not a single
machine was found. Hell, if even the router doesn't know anyone by
name, we're well f*ked!
You may wonder why Windows machines can still talk to each other when
using DHCP? The reason is that NETBIOS supplies the name-to-IP
translation and so covers up for the broken local (LAN) DNS.
So what seems to happen, at least where Linux is involved, is that the
only way one can get local, by which I mean LAN, DNS to work is to
have fixed IPs and set the name in the machine's hostname and supply
the translation of the name-to-IP in the each machine's hosts file. If
you want to use DHCP, then local DNS will not work.
Unless, perhaps, you write hosts on the fly each time a new IP is
received? I guess that's what to try next.
So, make a copy of hosts called host.org, and change the relevant
section in default.script to:
HOSTS="/etc/hosts"
...
# Set the hostname and write the hosts file
cp -f $HOSTS.org $HOSTS
if [ -n "$hostname" ]; then
echo "\t\thostname $hostname" >> $LOG
hostname $hostname
echo "$ip\t$hostname\t$hostname" >> $HOSTS
elif [ -f $HOSTNAME ]; then
echo "\t\thostname $(cat $HOSTNAME)" >> $LOG
hostname $(cat $HOSTNAME)
echo "$ip\t$(cat $HOSTNAME)\t$(cat $HOSTNAME)" >> $HOSTS
fi
C:\TEMP>ping dreambox
Pinging dreambox [xxx.xxx.xxx.xxx] with 32 bytes of data:
Reply from xxx.xxx.xxx.xxx: bytes=32 time<10ms TTL=64
Reply from xxx.xxx.xxx.xxx: bytes=32 time<10ms TTL=64
Reply from xxx.xxx.xxx.xxx: bytes=32 time<10ms TTL=64
Reply from xxx.xxx.xxx.xxx: bytes=32 time<10ms TTL=64
Ping statistics for xxx.xxx.xxx.xxx:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
HOORAY!
But frankly, what an almighty FU!
It seems to me that local (LAN) DNS is f*cked, at least in Linux. If
it isn't, how come even the routers don't know anyones' names, even
the ones that they themselves have dished out? And how come, despite
hours of searching the web, I was forced to devise a solution of my
own which is, frankly, a bit of a hack?
On Sun, 13 Feb 2011 13:28:44 +0000, Java Jive <ja...@evij.com.invalid>
wrote:
>
> 3) A particular problem seems to be that the Busybox implementation
> of udhcpc ignores the hostname sent to the router when setting the
> hostname on the machine.
...
> ... you can see that despite sending the correct hostname as set by
> the hostname file ...
>
> dreambox
>
> ... to the server, udhcpc has set the actual machine hostname to ...
>
> dhcppc3
>
> ... yet this doesn't appear to the be correct machine name either ...
>
> C:\TEMP>ping dhcppc3
> Unknown host dhcppc3.
I've just got in from work and am tired, but the following stand out:
> HOSTNAME='/etc/hostname'
what's in /etc/hostname?
> hostname="dreambox"
> Environment ...
> HOME='/'
> HOSTNAME='/etc/hostname'
those should be ` not '...
> hostname='dhcppc3'
> hostname dreambox
Make up your mind.. is it dhcppc3 or dreambox?
> /sbin/rdate -s ntp.pool.org
*cough* pool.ntp.org, actually. Better still, 0.uk.pool.ntp.org
>rdate: timeout connecting to time server
no wonder!
Someone will correct me if I am wrong, but I always thought the hostname
was set by the DHCP server, not the client. You seem to be trying to
tell the DHCP server what hostname you want to use.
>~ > bind --help
>-sh: bind: not found
The bind binary is called named*, but it's irrelevant. You don't want
to run a DNS server, you want a working client.
* bind = Berkeley Internet Name Daemon
>Everything on the WAN side of the router seems to have proper DNS
>support.
What happens if you hardwire your router's IP address into resolv.conf
and then try pinging google? Your router most likely will act as a DNS
forwarder, going out onto the WAN to resolve queries and then passing
the results back to the LAN side.
>Currently defined functions:
> nslookup,
nslookup -type=ANY www.google.com
post the output.
There is no need to do this, resolv.conf gets set up correctly with
the router's IP ...
> nslookup -type=ANY www.google.com
~ > nslookup -type=ANY www.google.com
BusyBox v1.00 (2005.02.11-15:27+0000) multi-call binary
Usage: nslookup [HOST] [SERVER]
~ > nslookup www.google.com
*** Unknown host
Name: www.l.google.com
Addresses: 74.125.230.116, 74.125.230.114, 74.125.230.113,
74.125.230.115, 74.1
25.230.112
As previously reported, names and addresses on the internet are not
the problem, I can ping seemingly anywhere on the internet, it's the
local (LAN - this side of the router) names that are the problem.
Note that I have found a fix for it though.
> In article <ikcgl6t5ma3t7ap98...@4ax.com>, Java Jive
> <ja...@evij.com.invalid> writes
>
> I've just got in from work and am tired, but the following stand out:
>
> > HOSTNAME='/etc/hostname'
>
> what's in /etc/hostname?
dreambox
> > hostname="dreambox"
>
> > Environment ...
> > HOME='/'
> > HOSTNAME='/etc/hostname'
>
> those should be ` not '...
Why? Can't see that it'll make much odds in this context.
> > hostname='dhcppc3'
>
> > hostname dreambox
>
> Make up your mind.. is it dhcppc3 or dreambox?
See my most recent post. udhcpc is trying to tell the router that we
want to use the name dreambox, but the router is setting it to dhcppc3
anyway. However neither name can be pinged.
> > /sbin/rdate -s ntp.pool.org
>
> *cough* pool.ntp.org, actually. Better still, 0.uk.pool.ntp.org
Ah!
> >rdate: timeout connecting to time server
>
> no wonder!
>
> Someone will correct me if I am wrong, but I always thought the hostname
> was set by the DHCP server, not the client. You seem to be trying to
> tell the DHCP server what hostname you want to use.
Yes, again, see my most recent post.
Yup, I know that - but couldn't at that moment work out whether there
was a server hiding on his box, active, and somehow making a mess out of
the resolving of his local network ...
In fact he has got /etc/host.conf as
'order hosts, bind'
where I've seen it elsewhere set as
'order bind, hosts'
Anyway, it's probably something else ...
--
Adrian C
>> those should be ` not '...
>Why? Can't see that it'll make much odds in this context.
It makes a helluva difference. Google the difference between `
(backwards apostrophe, the key to the left of the number 1 on a UK
keyboard and the apostrophe ' (the key two to the right of L on a UK
keyboard) in a *nix context.
In short, '/etc/hostname' is the string /etc/hostname. `/etc/hostname`
means "look up the contents of the file /etc/hostname".
>Ah!
:)
>Yes, again, see my most recent post.
I did, you're getting there. Good luck.
That just means search the hosts file before going to DNS.
--
Regards
Dave Saville
On Tue, 15 Feb 2011 19:12:49 +0000, Mike Tomlinson
<mi...@jasper.org.uk> wrote:
>
> In short, '/etc/hostname' is the string /etc/hostname. `/etc/hostname`
> means "look up the contents of the file /etc/hostname".
> `/etc/hostname` means "look up the contents of the file /etc/hostname".
No that means execute the contents of /etc/hostname which should result
in
`/etc/hostname`
sh: /etc/hostname: Permission denied
I think you probably misread it as HOSTNAME=`/bin/hostname` which would
return the current hostname in the environmental variable HOSTNAME.
> So what seems to happen, at least where Linux is involved, is that the
> only way one can get local, by which I mean LAN, DNS to work is to have
> fixed IPs and set the name in the machine's hostname and supply the
> translation of the name-to-IP in the each machine's hosts file. If you
> want to use DHCP, then local DNS will not work.
This is just plain mis-statement of the facts.
The DHCP server has to be able to dynamicall update the DNS records,
otherwise how else does the DNS server know the names of the hosts
on particular DHCP assigned addresses.
To learn how to do this please take a look at
<http://www.debianadmin.com/howto-setup-dhcp-server-and-dynamic-dns-with-bind-in-debian.html>
> On Tuesday, February 15th, 2011 at 02:20:31h +0000, Java Jive miscontrued:
>
> > So what seems to happen, at least where Linux is involved, is that the
> > only way one can get local, by which I mean LAN, DNS to work is to have
> > fixed IPs and set the name in the machine's hostname and supply the
> > translation of the name-to-IP in the each machine's hosts file. If you
> > want to use DHCP, then local DNS will not work.
>
> This is just plain mis-statement of the facts.
Well that is my experience thus far. How do account for the fact that
I cannot ping any machine on the LAN by host name even when telneted
into the router?
> The DHCP server has to be able to dynamicall update the DNS records,
> otherwise how else does the DNS server know the names of the hosts
> on particular DHCP assigned addresses.
It may 'know' them in the sense that the list of assigned IPs within
the router each has the name of a machine against it, but that doesn't
seem to help the router's functionality itself determine which machine
is referred to by a name. If it did, I'd be able to ping the machines
by name from within the router.
> To learn how to do this please take a look at
>
> <http://www.debianadmin.com/howto-setup-dhcp-server-and-dynamic-dns-with-bind-in-debian.html>
I've already spent the greater part of the afternoon trying to avoid
falling asleep over the Linux DNS FAQ. The trouble is that both these
documents are aimed at setting up a DHCP server, not a client.
So far, the only way that I've been able to get a pure Linux client
respond to its own name, whether that set by calling the hostname
binary or that suggested by DHCP return from the server, is by
including an appropriate line in /etc/hosts.
No, it means: EXECUTE the command /etc/hostname, you would need to add
an extra "cat " in front of it to get the contents of that file.
--
******************************************************************
** Eef Hartman, Delft University of Technology, dept. SSC/ICT **
** e-mail: E.J.M....@tudelft.nl - phone: +31-15-27 82525 **
******************************************************************
Again you miss the point, which is that that whatever is acting as the
DHCP server has to inform the DNS server which hostname is being allocated
to which IP address.
Now I may have overlooked this other critical point, but on which machine
are you running your DNS server for the hosts on your LAN?
> On Tue, 15 Feb 2011 22:00:29 +0000, Java Jive wrote:
>
> > I've already spent the greater part of the afternoon trying to avoid
> > falling asleep over the Linux DNS FAQ. The trouble is that both these
> > documents are aimed at setting up a DHCP server, not a client.
>
> Again you miss the point, which is that that whatever is acting as the
> DHCP server has to inform the DNS server which hostname is being allocated
> to which IP address.
I don't believe I've missed any point at all. After all, I've spent
several days now investigating this ...
> Now I may have overlooked this other critical point, but on which machine
> are you running your DNS server for the hosts on your LAN?
The router* is supposed to be acting as both as an external DNS relay
(by external, I mean beyond it on the WAN/Internet) and as an internal
DNS server (by internal I mean this side of it on the local LAN). It
is certainly doing the former, but it seems not the latter with the
way its clients are set up by default. With Windows clients, this is
not a problem, because NETBIOS enables them to talk to each other by
name, but with Linux clients, I've only been able to resolve the
problem by configuring a client's hosts file to resolve its own name
to its own IP. Although I've not been able to find a definitive
explanation of the way DNS should be set up on a client, my discovered
fix seems to me more like a kludge than an expected solution.
* That's why my point about not even the router knowing machines by
name is so significant!
Does the router DNS and your machines have the same domain name?
Normally one needs Zone records for a DNS server to know the IP to
Name mapping - and the reverse. What makes you think that the DHCP
server on the router talks to the DNS server on the router? Because
that is what needs to happen so that a DHCP request from "fred"
results in the DNS server being told that fred is such and such IP. To
force the DHCP *client* to send its name you need to set the required
option in the dhcp configuration on the client. Example: the following
are *requests* for information *except* option 12.
option 1 # Subnet Mask
option 3 # Router
option 6 # Domain Name Server
option 12 "paddington" # Host Name
option 15 # Domain Name
option 28 # Broadcast Address
option 33 # Static Routes
Some servers needs to be asked (nicely) explicitly :-)
HTH
--
Regards
Dave Saville
>No, it means: EXECUTE the command /etc/hostname, you would need to add
>an extra "cat " in front of it to get the contents of that file.
I said I was tired...
The machines all have the same NETBIOS workgroup name - that is the
Windows PCs, and Samba running on the NAS and the Dreambox.
I don't know how to set an equivalent in Linux, and anyway I don't
have a domain as such, apart from that for my website, which is
located physically remote from my LAN. I can give the router a system
name, which I have, and a domain name, which I've left blank, as
previous experience with other routers is that putting anything in
there kills connectivity with the internet (I'd previously thought
that maybe I could put the workgroup name in there).
What one really wants is for the router be running its own server to
attempt to resolve LAN names, but any name that it can't thus resolve
gets relayed outwards to the ISP DNS servers, and the reply relayed
back to the source of the query. My router seems to be doing the
latter, but not the former.
I would have hoped that there might be some system which would mean
"Search only the LAN, don't escalate this request for a name outside
of it", say a TLD so you could give machines names like name.local or
name.lan, but perhaps that is what is supposed to happen to an
unqualified name anyway? BTAIM, I don't know of any system of doing
that. Hence the router, the NAS, and the Dreambox are all given
'unqualified', I mean non-heirarchical, names, such as dreambox, and
the domain name in the router is blank.
> Normally one needs Zone records for a DNS server to know the IP to
> Name mapping - and the reverse. What makes you think that the DHCP
> server on the router talks to the DNS server on the router?
On the contrary, I beginning to think that part of the problem is that
they don't talk to each other at all.
Following are the settings for the relevant configuration page of my
router ...
DHCP: Server
(details of pool omitted)
DNS Server:
0.0.0.0
This latter seems to mean that DNS queries are relayed outwards to the
ISP DNS server provided when obtaining the connection. There is no
mention of any difference in behaviour for local and non-local
queries, so I presume it means that all queries are relayed, including
the LAN ones. The Help for this page is appended, in case anyone
reading it has another interpretation.
> Because
> that is what needs to happen so that a DHCP request from "fred"
> results in the DNS server being told that fred is such and such IP.
I wonder how one would set that up. There doesn't appear to be
anything in the router settings that looks relevant.
> To
> force the DHCP *client* to send its name you need to set the required
> option in the dhcp configuration on the client. Example: the following
> are *requests* for information *except* option 12.
>
> option 1 # Subnet Mask
> option 3 # Router
> option 6 # Domain Name Server
> option 12 "paddington" # Host Name
> option 15 # Domain Name
> option 28 # Broadcast Address
> option 33 # Static Routes
This quote from an earlier post shows that the client is requesting a
particular host name, but that the name that comes back from the
router is nevertheless an autogenerated one. I've since determined
that neither name can be pinged unless it is also resolved in the
clients host file.
On Sun, 13 Feb 2011 13:28:44 +0000, Java Jive <ja...@evij.com.invalid>
wrote:
> Here are the relevant lines from my script (I can post it in its
> entirety, put it up on my site, or PM you if you want to see the whole
> thing):
> if [ "$DHCP" != "00000000" ]
> then
> if [ -f /var/share/udhcpc/default.script ]
> then
> echo "/bin/udhcpc -fq -H $(cat $HOSTNAME)
> --script=/var/share/udhcpc/default.script" >> $LOG
> /bin/udhcpc -fq -H $(cat $HOSTNAME)
> --script=/var/share/udhcpc/default.script 2>> $LOG >> $LOG
> else
> echo "/bin/udhcpc -fq -H $(cat $HOSTNAME)" >>
> $LOG
> /bin/udhcpc -fq -H $(cat $HOSTNAME) 2>> $LOG
> >> $LOG
> fi
> else
> # etc
> fi
>
> cat /etc/resolv.conf >> $LOG
> hostname >> $LOG
>
> I know that the correct hostname is being sent to the router, because
> looking in its list of IP address given out by DHCP, the dreambox is
> listed by name, whereas if I just type udhcpc at a telnet prompt, the
> name field in the list is then blank. However, when I examine the log
> file fragment that the above script fragment produces (correct IP
> addresses mangled) ...
>
> NETWORK = 00000001
> DHCP = 00000001
> /bin/udhcpc -fq -H dreambox
> info, udhcpc (v0.9.9-pre) started
> debug, Sending discover...
> debug, Sending discover...
> debug, Sending discover...
> debug, Sending select for xxx.xxx.xxx.xxx ...
> info, Lease of xxx.xxx.xxx.xxx obtained, lease time 259200
> route: SIOC[ADD|DEL]RT: No such process
> # Generated by udhcpc
> nameserver xxx.xxx.xxx.xxx
> dhcppc3
>
> ... you can see that despite sending the correct hostname as set by
> the hostname file ...
>
> dreambox
>
> ... to the server, udhcpc has set the actual machine hostname to ...
(or rather, as since discovered, the router is sending back the
auto-generated name)
>
> dhcppc3
>
> ... yet this doesn't appear to the be correct machine name either ...
>
> C:\TEMP>ping dhcppc3
> Unknown host dhcppc3.
I can't understand why this problem appears to be so little discussed.
I can't find any definitive literature on how DNS should be set up on
the client. To my certain knowledge, it's been a problem with this
Dreambox as long as I've had it. I've also had it with my previous
router and a recent PC installation of SuSE, yet even with such a
well-known distro as SuSE, noone seemed to know much about it, let
alone provided a definite cure. In the end I just had to wipe the
distro and try another.
Router help page:
=================
DHCP Setup
Use this screen to configure the DNS server information that the
device sends to the DHCP client devices on the LAN.The following table
describes the labels in this screen.
DHCP Setup
DHCP Setup
DHCP
If set to Server, your device can assign IP addresses, an IP default
gateway and DNS servers to Windows 95, Windows NT and other systems
that support the DHCP client.
If set to None, the DHCP server will be disabled.
If set to Relay, the device acts as a surrogate DHCP server and relays
DHCP requests and responses between the remote server and the clients.
Enter the IP address of the actual, remote DHCP server in the Remote
DHCP Server field in this case.
When DHCP is used, the following items need to be set:
IP Pool Starting Address
This field specifies the first of the contiguous addresses in the IP
address pool.
Pool Size
This field specifies the size, or count of the IP address pool.
Remote DHCP Server
If Relay is selected in the DHCP field above then enter the IP address
of the actual remote DHCP server here.
DNS Server
Primary DNS Server
Secondary DNS Server
This field is not available when you set DHCP to Relay.
Enter the IP addresses of the DNS servers. The DNS servers are passed
to the DHCP clients along with the IP address and the subnet mask.
If the fields are left as 0.0.0.0, the device acts as a DNS proxy and
forwards the DHCP client's DNS query to the real DNS server learned
through IPCP and relays the response back to the computer.
Ha - if the router has 0.0.0.0 as its DNS server address then it is
going to forward *all* requests to your ISP who of course knows zilch
about your LAN. Can you put more than one address in there? If so try
putting its own LAN address first and then 0.0.0.0
> No difference. Neither from a Windows PC, nor even from within a
> telnet session into the router itself, can I ping it by name, only by
> IP.
>
> On Wed, 16 Feb 2011 22:28:39 +0000 (UTC), "Dave Saville"
> <da...@invalid.invalid> wrote:
> >
> > Ha - if the router has 0.0.0.0 as its DNS server address then it is
> > going to forward *all* requests to your ISP who of course knows zilch
> > about your LAN. Can you put more than one address in there? If so try
> > putting its own LAN address first and then 0.0.0.0
Have lost the start of the thread - What is the router again?
--
Regards
Dave Saville
On Thu, 17 Feb 2011 11:00:39 +0000 (UTC), "Dave Saville"
<da...@invalid.invalid> wrote:
>
> Have lost the start of the thread - What is the router again?
--
> It's a Zyxel P-660H-D.
>
> On Thu, 17 Feb 2011 11:00:39 +0000 (UTC), "Dave Saville"
> <da...@invalid.invalid> wrote:
> >
> > Have lost the start of the thread - What is the router again?
Having read the manual, not much different to my P-660HW-T1, I don't
think you can.
Remember the DNS of the router works either as a proxy, 0.0.0.0,
forwarding DNS requests to whatever DNS server he has been told about
on connection OR you fill in addresses of known DNS servers and they
get bounced to that/them.
You *can* do what you want and this
http://ubuntuforums.org/archive/index.php/t-1439.html may help - but
you need a "real" DNS server running somewhere on your network It may
be possible to run one on your dreambox but I don't know. Also such a
box really needs to be up all the time the LAN is in use. A possible
help in sorting might be to download a linux bootable demo CD. I
predict it will have the same problems as the dreambox.
With what you have there is no "real" DNS server that can process the
hostname. Just had a play here and even though my LAN client list
shows the supplied hostnames from connected boxes you can't ping em by
name. As most of the LAN is fixed I use the assign IP by MAC address
feature of the router so boxes that do use DHCP always get the same
address. So I can (usually) remember the IP and ping/telnet/ftp using
that.
--
Regards
Dave Saville