--- dmucs-0.6.1.orig/monitor.cc
+++ dmucs-0.6.1/monitor.cc
@@ -227,7 +227,8 @@
 	    std::string hostname = (he != NULL) ? he->h_name : ipstr;
             /* Remove everything from the first . onward -- so we don't see
                the long domain name in the output. */
-            hostname.erase(hostname.find_first_of('.'));
+            if (hostname.find_first_of('.') != std::string::npos)
+                hostname.erase(hostname.find_first_of('.'));
 
 	    /*
 	     * We collect each hostname based on its state, and add it
@@ -281,7 +282,8 @@
                 } else {
                   hname = he->h_name;
                   /* Remove domain name from end of hostname. */
-                  hname.erase(hname.find_first_of('.'));
+                  if (hname.find_first_of('.') != std::string::npos)
+                      hname.erase(hname.find_first_of('.'));
                 }
 		std::ostringstream hostname;
 		hostname << hname;
