GameServerManagers / GameServerManagers/LinuxGSM

[Server Request] TSDNS as single Server

Open
#2,007 1 comment 1 reaction 0 assignees View on GitHub
engine: null game: Teamspeak 3 type: game server request
Dominant language
Shell
Stars
4.9k
Forks
864
PR merge metrics
No merged PRs in 30d

Description

I would like that TSDNS is implemented as a external server, so it is independent of teamspeak.
The server is included in the teamspeak-server archiv under tsdns. It's just a binary file with tsdns_settings.ini.sample-file as configuration. That file is needed to copy to tsdns_Settings.ini.

I have repacked and uploaded you just the directory where its included.
In 32-Bit directory:
[tsdns.zip](https://github.com/GameServerManagers/LinuxGSM/files/2371755/tsdns.zip)
Virustotal:
https://www.virustotal.com/de/file/a6865310c76daad0d14d4b5e3e8f5cf864e5e8d94ec723b0a5a147201661d336/analysis/1536681923/
In 64-Bit directory:
[tsdns.zip](https://github.com/GameServerManagers/LinuxGSM/files/2371787/tsdns.zip)
Virustotal:
https://www.virustotal.com/de/file/2a4a8daf705d81e381e9b1a774d8a963fe7349e79c84d25847d882e6da077b37/analysis/1536682405/

The only difference, I find, is that the binary in the x86-dir is a bit bigger(about 10kb)

Or maybe you want to download yourself the current server.

I also found a german guide, but letting you his scripts here, so you can understand how tsdns works.
Also mentioned here: https://github.com/GameServerManagers/LinuxGSM/issues/1978#issuecomment-416683004
http://krischan.eu/index.php/2013/06/04/howto-tsdns-startscript-autostartscript/

tsdns_startscript.sh:
```
#!/bin/bash
#
# Copyright (c) TeamSpeak Systems GmbH. All rights reserved.
#
### BEGIN INIT INFO
# Provides: tsdnsserver-linux-x86
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: TSDNS Server
# Description: Resolves hostnames to IP and port numbers
### END INIT INFO

if [ -e "tsdnsserver_linux_x86" ]; then
BINARYNAME="tsdnsserver_linux_x86"
else
BINARYNAME="tsdnsserver_linux_x86" #für 64-Bit tsdnsserver_linux_amd64

fi

BINARYPATH="/dir/to/server/tsdns" #richtiges Verzeichnis setzen

cd "${BINARYPATH}"
LIBRARYPATH="$(pwd)"

case "$1" in
start)
if [ -e tsdnsserver.pid ]; then
if ( kill -0 $(cat tsdnsserver.pid) 2> /dev/null ); then
echo "The server is already running, try restart or stop..."
exit 1
else
echo "tsdnsserver.pid found, but no server running. Possibly your previously started server crashed..."
echo "Please view the logfile for details."
rm tsdnsserver.pid
fi
fi
if [ "${UID}" = "0" ]; then
echo "WARNING: For security reasons we advise: DO NOT RUN THE SERVER AS ROOT!!!"
for c in $(seq 1 10); do
echo -n "!"
sleep 1
done
echo "!"
fi
echo "Starting the TSDNS Server."
if [ -e "$BINARYNAME" ]; then
if [ ! -x "$BINARYNAME" ]; then
echo "${BINARYNAME} is not executable, trying to set it..."
chmod u+x "${BINARYNAME}"
fi
if [ -x "$BINARYNAME" ]; then
export LD_LIBRARY_PATH="${LIBRARYPATH}:${LD_LIBRARY_PATH}"
"./${BINARYNAME}" > /dev/null &
echo $! > tsdnsserver.pid
echo "TSDNS Server started, for details please view the log file..."
else
echo "${BINARNAME} is not exectuable, cannot start TSDNS Server..."
fi
else
echo "Could not find ${BINARYNAME}, aborting..."
exit 5
fi
;;
stop)
if [ -e tsdnsserver.pid ]; then
echo -n "Stopping the TSDNS Server."
if ( kill -TERM $(cat tsdnsserver.pid) 2> /dev/null ); then
for c in $(seq 1 300); do
if ( kill -0 $(cat tsdnsserver.pid) 2> /dev/null ); then
echo -n "."
sleep 1
else
break
fi
done
fi
if ( kill -0 $(cat tsdnsserver.pid) 2> /dev/null ); then
echo "Server is not shutting down cleanly - killing..."
kill -KILL $(cat tsdnsserver.pid)
else
echo "done"
fi
rm tsdnsserver.pid
else
echo "No server runing (tsdnsserver.pid is missing)..."
exit 7
fi
;;
update)
if [ -e tsdnsserver.pid ]; then
echo "Updating the TSDNS Server."
export LD_LIBRARY_PATH="${LIBRARYPATH}:${LD_LIBRARY_PATH}"
"./${BINARYNAME}" --update > /dev/null &
echo "TSDNS Server updated, for details please view the log file..."
else
echo "No server runing (tsdnsserver.pid is missing)..."
exit 7
fi
;;
restart)
$0 stop && $0 start || exit 1
;;
status)
if [ -e tsdnsserver.pid ]; then
if ( kill -0 $(cat tsdnsserver.pid) 2> /dev/null ); then
echo "Server is running."
else
echo "Server seems to have died."
fi
else
echo "No server running (tsdnsserver.pid is missing)..."
fi
;;
*)
echo "Usage: ${0} {start|stop|update|restart|status}"
exit 2
esac
exit 0
```

Autostartscript – tsdns

```
#!/bin/sh
# chkconfig: 2345 99 01
# description: Teamspeak 3 TSDNS-Server
### BEGIN INIT INFO
# Provides: teamspeak3dns
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Teamspeak 3 TSDNS-Server
### END INIT INFO

USER="teamspeak"
DIR="/dir/to/Server" # richtiges Verzeichnis setzen

case "$1" in
start)
su $USER -c "${DIR}/tsdns/tsdns_startscript.sh start"
;;
stop)
su $USER -c "${DIR}/tsdns/tsdns_startscript.sh stop"
;;
restart)
su $USER -c "${DIR}/tsdns/tsdns_startscript.sh restart"
;;
status)
su $USER -c "${DIR}/tsdns/tsdns_startscript.sh status"
;;
*)
echo "Benutze: `basename $0` {start|stop|restart|status}" >&2
exit 1
;;
esac
exit 0
```

Fully supported on Linux

For updating and installing I found only one possible way.
Check TeamSpeak version. Download the current. extract, maybe only tsdns-folder -> config doesn't get overwritten cause there is only an ini.example which must be renamed to ini on install.
Don't know if it still recieves updates.
Latest entry from changelog with tsdns mentions:
=== Server Release 3.0.13.6 9 november 2016
- TSDNS server now also listens on ipv6 when available
* TSDNS server Documentation updated

EDIT:
I should also mention that the config is taken from your current directory and not from the binary directory.

Commandline parameter:
```
./tsdnsserver --h
Usage: "./tsdnsserver [port]" or "./tsdnsserver --update"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.