diff --git a/src/apps/netbiosns/netbiosns.c b/src/apps/netbiosns/netbiosns.c
index 3f5db02d..99224966 100644
--- a/src/apps/netbiosns/netbiosns.c
+++ b/src/apps/netbiosns/netbiosns.c
@@ -1,6 +1,10 @@
 /**
  * @file
  * NetBIOS name service responder
+ *    Modifications by Ray Abram to respond to NetBIOS name requests when Incoming name = *
+ *       - based on code from "https://github.com/esp8266/Arduino/commit/1f7989b31d26d7df9776a08f36d685eae7ac8f99"
+ *       - with permission to relicense to BSD from original author:
+ *         http://www.xpablo.cz/?p=751#more-751
  */
 
 /**
@@ -80,6 +84,10 @@
 #define NETB_NFLAG_NODETYPE_PNODE     0x2000U
 #define NETB_NFLAG_NODETYPE_BNODE     0x0000U
 
+#define NETB_NFLAG_NAME_IN_CONFLICT   0x0800U                                 // 1=Yes,0=no
+#define NETB_NFLAG_NAME_IS_ACTIVE     0x0400U                                 // 1=Yes,0=no
+#define NETB_NFLAG_NAME_IS_PNAME      0x0200U                                 // 1=Yes,0=no Name is Permanent Node Name
+
 /** NetBIOS message header */
 #ifdef PACK_STRUCT_USE_INCLUDES
 #  include "arch/bpstruct.h"
@@ -132,6 +140,29 @@ PACK_STRUCT_END
 #  include "arch/epstruct.h"
 #endif
 
+// The NBNS Structure NBNS Structure Response Responds to a Name Query
+#ifdef PACK_STRUCT_USE_INCLUDES
+#  include "arch/bpstruct.h"
+#endif
+PACK_STRUCT_BEGIN
+struct netbios_answer {
+  struct netbios_hdr      answer_hdr;
+  PACK_STRUCT_FIELD(u8_t  NameSize);                              // the length of the next string
+  PACK_STRUCT_FLD_8(u8_t  QueryName[(NETBIOS_NAME_LEN * 2) + 1]); // WARNING!!! this item may be of a different length
+  PACK_STRUCT_FIELD(u16_t PacketType);
+  PACK_STRUCT_FIELD(u16_t PacketClass);
+  PACK_STRUCT_FIELD(u32_t TimeToLive);
+  PACK_STRUCT_FIELD(u16_t DataLength);
+  PACK_STRUCT_FLD_8(u8_t  NumberOfNames);                        // number of names
+  PACK_STRUCT_FLD_8(u8_t  AnswerName[NETBIOS_NAME_LEN]);         // node name
+  PACK_STRUCT_FIELD(u16_t AnswerNameFlags);                      // node flags
+  PACK_STRUCT_FLD_8(u8_t  NameType);                             // type name
+} PACK_STRUCT_STRUCT;
+PACK_STRUCT_END
+#ifdef PACK_STRUCT_USE_INCLUDES
+#  include "arch/epstruct.h"
+#endif
+
 #ifdef NETBIOS_LWIP_NAME
 #define NETBIOS_LOCAL_NAME NETBIOS_LWIP_NAME
 #else
@@ -198,7 +229,7 @@ netbiosns_name_decode(char *name_enc, char *name_dec, int name_dec_len)
 
 #if 0 /* function currently unused */
 /** Encode a NetBIOS name (from string to packet) - currently unused because
-    we don't ask for names. */
+ we don't ask for names. */
 static int
 netbiosns_name_encode(char *name_enc, char *name_dec, int name_dec_len)
 {
@@ -307,11 +338,44 @@ netbiosns_recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t
             /* free the "reference" pbuf */
             pbuf_free(q);
           }
+        } else if (0 == lwip_strnicmp(netbios_name, "*", sizeof(NETBIOS_LOCAL_NAME))) {
+          struct pbuf *q;
+          struct netbios_answer *resp;
+
+          q = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct netbios_answer), PBUF_RAM);
+          if (q != NULL) {
+            // general query - ask for our IP address
+            resp = (struct netbios_answer *) q->payload;                // buffer, to which a response is compiled
+
+            resp->answer_hdr.trans_id        = netbios_hdr->trans_id;   // copy the query to the response ID
+            resp->answer_hdr.flags           = PP_HTONS(NETB_HFLAG_RESPONSE | NETB_HFLAG_OPCODE_NAME_QUERY | NETB_HFLAG_AUTHORATIVE);                  // 0x8400 acknowledgment of termination
+            resp->answer_hdr.questions       = PP_HTONS(0);
+            resp->answer_hdr.answerRRs       = PP_HTONS(1);             // serial number of the answer
+            resp->answer_hdr.authorityRRs    = PP_HTONS(0);
+            resp->answer_hdr.additionalRRs   = PP_HTONS(0);
+            resp->NameSize                   = netbios_name_hdr->nametype;        // we will copy the length of the station name
+            memcpy(resp->QueryName, netbios_name_hdr->encname, (NETBIOS_NAME_LEN * 2) + 1);    // we will copy the queried name
+            resp->PacketType                 = PP_HTONS(0x21);          // NBSTAT
+            resp->PacketClass                = PP_HTONS(1);             // Internet name
+            resp->TimeToLive                 = PP_HTONL(0);
+            resp->DataLength                 = PP_HTONS(4 + NETBIOS_NAME_LEN);
+            resp->NumberOfNames              = 1;                       // Number of names
+
+            memset(resp->AnswerName, 0x20, NETBIOS_NAME_LEN);
+            MEMCPY(resp->AnswerName, NETBIOS_LOCAL_NAME, strlen(NETBIOS_LOCAL_NAME));
+
+            resp->AnswerNameFlags              = PP_HTONS(NETB_NFLAG_NAME_IS_ACTIVE);  // b-node, unique, active
+            resp->NameType               = 0;                       // Workstation/Redirector
+
+            udp_sendto(upcb, q, addr, port);
+            pbuf_free(q);
+          }
         }
       }
+
+      /* free the pbuf */
+      pbuf_free(p);
     }
-    /* free the pbuf */
-    pbuf_free(p);
   }
 }
 
@@ -340,6 +404,7 @@ netbiosns_init(void)
 /**
  * @ingroup netbiosns
  * Set netbios name. ATTENTION: the hostname must be less than 15 characters!
+ *                              the NetBIOS name spec says the name MUST be upper case, so incoming name is forced into uppercase :-)
  */
 void
 netbiosns_set_name(const char *hostname)
@@ -351,6 +416,12 @@ netbiosns_set_name(const char *hostname)
     copy_len = NETBIOS_NAME_LEN - 1;
   }
   MEMCPY(netbiosns_local_name, hostname, copy_len + 1);
+
+  // make name into upper case
+  size_t i;
+  for ( i = 0; i < copy_len; i++ ) {
+    netbiosns_local_name[i] = toupper(netbiosns_local_name[i]);
+  }
 }
 #endif
 
