Discussion:
[BackupPC-users] host resolution problem
Gabriel Rossetti
2011-03-19 20:02:32 UTC
Permalink
Hello everyone,

I read up on how BackupPC finds hosts, in my case nmblookup works. The
problem is that when it tries to run the ssh command, it uses the host's
name and not the IP it finds with nmblookup, so ssh exits complaining it
can't find the host. How can I get BackupPC to use the IP found using
nmblookup? I thought it would automatically do this since it can't
resolve it directly, but I guess not.

Thanks,
Gabriel
Papp Tamas
2011-03-19 20:49:35 UTC
Permalink
Post by Gabriel Rossetti
Hello everyone,
I read up on how BackupPC finds hosts, in my case nmblookup works. The
problem is that when it tries to run the ssh command, it uses the host's
name and not the IP it finds with nmblookup, so ssh exits complaining it
can't find the host. How can I get BackupPC to use the IP found using
nmblookup? I thought it would automatically do this since it can't
resolve it directly, but I guess not.
hi Gabriel,

If I understand you well, you want to set ClientNameAlias .

tamas
Gabriel Rossetti
2011-03-20 17:06:50 UTC
Permalink
Post by Papp Tamas
Post by Gabriel Rossetti
Hello everyone,
I read up on how BackupPC finds hosts, in my case nmblookup works. The
problem is that when it tries to run the ssh command, it uses the host's
name and not the IP it finds with nmblookup, so ssh exits complaining it
can't find the host. How can I get BackupPC to use the IP found using
nmblookup? I thought it would automatically do this since it can't
resolve it directly, but I guess not.
hi Gabriel,
If I understand you well, you want to set ClientNameAlias .
tamas
Hi Tamas,

not really, I must not have explained myself correctly. I have a local
network with a server that backs up our laptops. The laptops use DHCP to
get their IPs, they are Macs and Linux laptops. For my example I will
use a notebook called "myNotebook". It can't be resoved using DNS
resolution, but nmblookup can find it. The problem is that although
nmblookup finds it, when the backup script tries to ssh on to that
notebook it can't find the host because instead of using the IP it uses
the client/host name. Here is the output of BackupPC_dump, maybe that
will help to understand the problem:

----------------------------------------------------------------------------------------------------------------------------------------------------------------
$ /usr/share/backuppc/bin/BackupPC_dump -v -f myNotebook
Name server doesn't know about myNotebook; trying NetBios
cmdSystemOrEval: about to system /usr/bin/nmblookup myNotebook
cmdSystemOrEval: finished: got output querying myNotebook on 192.168.0.255
querying myNotebook on 192.168.1.255
192.168.1.69 myNotebook<00>

NetBiosHostIPFind: found IP address 192.168.1.69 for host myNotebook
cmdSystemOrEval: about to system /bin/ping -c 1 192.168.1.69
cmdSystemOrEval: finished: got output PING 192.168.1.69 (192.168.1.69)
56(84) bytes of data.
64 bytes from 192.168.1.69: icmp_req=1 ttl=64 time=12.3 ms

--- 192.168.1.69 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 12.382/12.382/12.382/0.000 ms

cmdSystemOrEval: about to system /bin/ping -c 1 192.168.1.69
cmdSystemOrEval: finished: got output PING 192.168.1.69 (192.168.1.69)
56(84) bytes of data.
64 bytes from 192.168.1.69: icmp_req=1 ttl=64 time=4.44 ms

--- 192.168.1.69 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 4.448/4.448/4.448/0.000 ms

CheckHostAlive: returning 4.448
cmdSystemOrEval: about to system /usr/bin/nmblookup -A 192.168.1.69
cmdSystemOrEval: finished: got output Looking up status of 192.168.1.69
myNotebook <00> - B <ACTIVE>
myNotebook <03> - B <ACTIVE>
myNotebook <20> - B <ACTIVE>
..__MSBROWSE__. <01> - <GROUP> B <ACTIVE>
WORKGROUP <1d> - B <ACTIVE>
WORKGROUP <1e> - <GROUP> B <ACTIVE>
WORKGROUP <00> - <GROUP> B <ACTIVE>

MAC Address = 00-00-00-00-00-00


NetBiosInfoGet: success, returning host myNotebook, user myNotebook
full backup started for directory /etc
started full dump, share=/etc
Running: /usr/bin/ssh -x -l root myNotebook /usr/bin/rsync --server
--sender --numeric-ids --perms --owner --group -D --links --hard-links
--times --block-size=2048 --recursive --ignore-times . /etc/
Xfer PIDs are now 21437
xferPids 21437
Got remote protocol 979923827
Fatal error (bad version): ssh: Could not resolve hostname myNotebook:
Name or service not known

Can't write 4 bytes to socket
fileListReceive() failed
Done: 0 files, 0 bytes
Got fatal error during xfer (fileListReceive failed)
Backup aborted by user signal
Not saving this as a partial backup since it has fewer files than the
prior one (got 0 and 0 files versus 0)
dump failed: fileListReceive failed
----------------------------------------------------------------------------------------------------------------------------------------------------------------


I would have thought that BackupPC would have used the IP address
instead of the client/host name when it can't be resolved using DNS
resolution, but this is not the case it seems. Does anyone know how I
can set this up so that our laptops can be backed up and still use
dynamic IPs (and thus be referred to by host name)?

Thank you,
Gabriel
Matthias Meyer
2011-03-20 19:34:19 UTC
Permalink
Post by Gabriel Rossetti
Hello everyone,
I read up on how BackupPC finds hosts, in my case nmblookup works. The
problem is that when it tries to run the ssh command, it uses the host's
name and not the IP it finds with nmblookup, so ssh exits complaining it
can't find the host. How can I get BackupPC to use the IP found using
nmblookup? I thought it would automatically do this since it can't
resolve it directly, but I guess not.
Whats about to configure $Conf{SshPath} to use a self made script which use
ssh by IP instead name.

Another (in my point of view much better) way is to configure your clients
to tell their DNS-names to the DNS service.
In Linux you can reach this by editing /etc/dhcp3/dhclient.conf or
/etc/dhcp/dhclient.conf (at least in Debian)
Write there a line 'send host-name "<hostname>";'

br
Matthias
--
Don't Panic
Gabriel Rossetti
2011-03-21 07:34:02 UTC
Permalink
Post by Matthias Meyer
Post by Gabriel Rossetti
Hello everyone,
I read up on how BackupPC finds hosts, in my case nmblookup works. The
problem is that when it tries to run the ssh command, it uses the host's
name and not the IP it finds with nmblookup, so ssh exits complaining it
can't find the host. How can I get BackupPC to use the IP found using
nmblookup? I thought it would automatically do this since it can't
resolve it directly, but I guess not.
Whats about to configure $Conf{SshPath} to use a self made script which use
ssh by IP instead name.
Another (in my point of view much better) way is to configure your clients
to tell their DNS-names to the DNS service.
In Linux you can reach this by editing /etc/dhcp3/dhclient.conf or
/etc/dhcp/dhclient.conf (at least in Debian)
Write there a line 'send host-name "<hostname>";'
br
Matthias
I will try that with the linux clients, I'm not sure if I can with the
Mac clients though.

thanks,
Gabriel
Tyler J. Wagner
2011-03-21 08:52:06 UTC
Permalink
Post by Gabriel Rossetti
I will try that with the linux clients, I'm not sure if I can with the
Mac clients though.
Ubuntu releases (for at least the last 4 years) default to this, as do
the Macs in my office. So do the Windows XP machines. Even the printer
does it. I doubt you'll have to change anything at the clients.
Post by Gabriel Rossetti
That's the thing, I don't really control it, it's an ADSL router
provided by my internet provider, I can't even change the IP range.
Not having control over your own router is another problem. If I were
you, I'd either replace it, or put another router between it and your
LAN, which you do control. OpenWRT and DD-WRT both kick ass, and both
use DNSMasq by default.

Regards,
Tyler
--
"We must not confuse dissent with disloyalty. We must remember always
that accusation is not proof and that conviction depends upon evidence
and due process of law. We will not walk in fear, one of another. We
will not be driven by fear into an age of unreason, if we dig deep in
our history and our doctrine, and remember that we are not descended
from fearful men — not from men who feared to write, to speak, to
associate and to defend causes that were, for the moment, unpopular."
-- Edward R. Murrow
Gabriel Rossetti
2011-03-21 17:41:58 UTC
Permalink
Post by Tyler J. Wagner
Post by Gabriel Rossetti
I will try that with the linux clients, I'm not sure if I can with the
Mac clients though.
Ubuntu releases (for at least the last 4 years) default to this, as do
the Macs in my office. So do the Windows XP machines. Even the printer
does it. I doubt you'll have to change anything at the clients.
Yah, it's there, so my router's DHCP server must not use it
Post by Tyler J. Wagner
Post by Gabriel Rossetti
That's the thing, I don't really control it, it's an ADSL router
provided by my internet provider, I can't even change the IP range.
Not having control over your own router is another problem. If I were
you, I'd either replace it, or put another router between it and your
LAN, which you do control. OpenWRT and DD-WRT both kick ass, and both
use DNSMasq by default.
Regards,
Tyler
Les Mikesell
2011-03-21 18:41:19 UTC
Permalink
Post by Gabriel Rossetti
Post by Tyler J. Wagner
Post by Gabriel Rossetti
I will try that with the linux clients, I'm not sure if I can with the
Mac clients though.
Ubuntu releases (for at least the last 4 years) default to this, as do
the Macs in my office. So do the Windows XP machines. Even the printer
does it. I doubt you'll have to change anything at the clients.
Yah, it's there, so my router's DHCP server must not use it
Gabriel Rossetti
2011-03-21 22:28:14 UTC
Permalink
Post by Gabriel Rossetti
Post by Tyler J. Wagner
Post by Gabriel Rossetti
I will try that with the linux clients, I'm not sure if I can with the
Mac clients though.
Ubuntu releases (for at least the last 4 years) default to this, as do
the Macs in my office. So do the Windows XP machines. Even the printer
does it. I doubt you'll have to change anything at the clients.
Yah, it's there, so my router's DHCP server must not use it
Travis Fraser
2011-03-21 02:18:22 UTC
Permalink
Post by Gabriel Rossetti
Hi Tamas,
not really, I must not have explained myself correctly. I have a local
network with a server that backs up our laptops. The laptops use DHCP to
get their IPs, they are Macs and Linux laptops. For my example I will
use a notebook called "myNotebook". It can't be resoved using DNS
resolution, but nmblookup can find it.
If you control the DHCP server, why not assign a known IP address to
each of the laptops? Then use either DNS, or put the laptop entries into
the hosts file on the backuppc server.
--
Travis Fraser <***@snowpatch.net>
Tyler J. Wagner
2011-03-21 07:11:26 UTC
Permalink
Post by Travis Fraser
Post by Gabriel Rossetti
not really, I must not have explained myself correctly. I have a local
network with a server that backs up our laptops. The laptops use DHCP to
get their IPs, they are Macs and Linux laptops. For my example I will
use a notebook called "myNotebook". It can't be resoved using DNS
resolution, but nmblookup can find it.
If you control the DHCP server, why not assign a known IP address to
each of the laptops? Then use either DNS, or put the laptop entries into
the hosts file on the backuppc server.
You don't have to use static DHCP assignments for that. You can tie DNS
and DHCP together so that hostnames resolve. The easy way is to use
DNSMasq. The slightly harder way is to configure ISC DHCPD to update
BIND dynamically.

Regards,
Tyler
--
"Beware of altruism. It is based on self-deception, the root of all evil."
-- Lazarus Long, "Time Enough for Love", by Robert A. Heinlein
Gabriel Rossetti
2011-03-21 07:35:21 UTC
Permalink
Post by Travis Fraser
Post by Gabriel Rossetti
Hi Tamas,
not really, I must not have explained myself correctly. I have a local
network with a server that backs up our laptops. The laptops use DHCP to
get their IPs, they are Macs and Linux laptops. For my example I will
use a notebook called "myNotebook". It can't be resoved using DNS
resolution, but nmblookup can find it.
If you control the DHCP server, why not assign a known IP address to
each of the laptops? Then use either DNS, or put the laptop entries into
the hosts file on the backuppc server.
That's the thing, I don't really control it, it's an ADSL router
provided by my internet provider, I can't even change the IP range.

Cheers,
Gabriel
Loading...