# # Copyright(C) 2008 Litesim Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # from common import console from common.named import litesim_named import config class NameServer(litesim_named): def get_record(self,type,name): if name.endswith('.regions.litesim.com.'): print name.split('.regions.litesim.com')[0] else: return None print "Starting up nameserver..." nameserver = NameServer() nameserver.start_server() console_banner = """ Nameserver console ready Use ctrl+D then enter to shutdown """ console.SimpleConsole('__main__').interact(console_banner) ~ ~ ~