Allow fully qualified domains in the NICs table to override the
[invirt/packages/invirt-dhcp.git] / dhcpserver.py
index 8f4a129..3133643 100644 (file)
@@ -109,9 +109,12 @@ class DhcpBackend:
         ip = nic.ip
         if ip is None:  #Deactivated?
             return False
-        hostname = nic.machine.name
-        if hostname is not None:
-            hostname += ".servers.csail.mit.edu"
+        if nic.hostname and '.' in nic.hostname:
+            hostname = nic.hostname
+        elif nic.machine.name:
+            hostname = nic.machine.name + '.servers.csail.mit.edu'
+        else:
+            hostname = None
         if ip is not None:
             ip = ipv4(ip)
             Log.Output(Log.debug,"dhcp_backend : Discover result = "+str(ip))