个人工具

UbuntuHelp:UbuntuLTSP/HostnameFromDNS

来自Ubuntu中文

跳转至: 导航, 搜索
This page is specific to Ubuntu versions 9.10

If you find this information applicable to additional versions/releases, please edit this page and modify this header to reflect that. Please also include any necessary modifications for this information to apply to the additional versions.


Sometimes it's interesting to have the thin clients hostname coming from DNS, through PTR (reverse) records. This script performs a DNS query with the thin client IP address and in case of a good answer, it sets the thin client hostname accordingly. http://hackers.propus.com.br/~marlon/ltsp/dns2hostname.py Important: do not use this script if you don't have PTR records for all your DHCP range. How to install the script into an i386 image:

DIR='/opt/ltsp/i386'
mount -t proc proc $DIR/proc
mount -t devpts devpts $DIR/dev/pts
chroot $DIR bash

# Under the chroot

cd /etc/init.d
wget -c http://hackers.propus.com.br/~marlon/ltsp/dns2hostname.py
chmod +x dns2hostname.py
apt-get install python-dnspython # if not installed
cd /etc/rcS.d
ln -s ../init.d/dns2hostname.py S33dns2hostname.py
exit

umount $DIR/dev/pts
umount $DIR/proc

ltsp-update-image --arch i386

Reboot your thin clients and test it. Good luck.