diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 8ba3f1c..a6ba562 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -220,7 +220,7 @@
                                 ethData.speed = *speed;
                             }
                         }
-                        else if (propertyPair.first == "NameServers")
+                        else if (propertyPair.first == "Nameservers")
                         {
                             const std::vector<std::string> *nameservers =
                                 sdbusplus::message::variant_ns::get_if<
@@ -1160,6 +1160,31 @@
         }
     }
 
+    void handleStaticNameServersPatch(
+        const std::string &ifaceId,
+        const std::vector<std::string> &updatedStaticNameServers,
+        const std::shared_ptr<AsyncResp> &asyncResp)
+    {
+        crow::connections::systemBus->async_method_call(
+            [asyncResp,
+             updatedStaticNameServers](const boost::system::error_code ec) {
+                if (ec)
+                {
+                    messages::internalError(asyncResp->res);
+                    return;
+                }
+                asyncResp->res.jsonValue["NameServers"] =
+                    updatedStaticNameServers;
+                asyncResp->res.jsonValue["StaticNameServers"] =
+                    updatedStaticNameServers;
+            },
+            "xyz.openbmc_project.Network",
+            "/xyz/openbmc_project/network/" + ifaceId,
+            "org.freedesktop.DBus.Properties", "Set",
+            "xyz.openbmc_project.Network.EthernetInterface", "Nameservers",
+            std::variant<std::vector<std::string>>{updatedStaticNameServers});
+    }
+
     void parseInterfaceData(
         nlohmann::json &json_response, const std::string &iface_id,
         const EthernetInterfaceData &ethData,
@@ -1199,6 +1224,7 @@
                               iface_id + "/VLANs"}};
 
         json_response["NameServers"] = ethData.nameservers;
+        json_response["StaticNameServers"] = ethData.nameservers;
 
         if (ipv4Data.size() > 0)
         {
@@ -1270,10 +1296,12 @@
         std::optional<std::string> macAddress;
         std::optional<nlohmann::json> ipv4Addresses;
         std::optional<nlohmann::json> ipv6Addresses;
+        std::optional<std::vector<std::string>> staticNameServers;
 
         if (!json_util::readJson(
                 req, res, "HostName", hostname, "IPv4Addresses", ipv4Addresses,
-                "IPv6Addresses", ipv6Addresses, "MACAddress", macAddress))
+                "IPv6Addresses", ipv6Addresses, "MACAddress", macAddress,
+                "StaticNameServers", staticNameServers))
         {
             return;
         }
@@ -1285,7 +1313,8 @@
             [this, asyncResp, iface_id, hostname = std::move(hostname),
              macAddress = std::move(macAddress),
              ipv4Addresses = std::move(ipv4Addresses),
-             ipv6Addresses = std::move(ipv6Addresses)](
+             ipv6Addresses = std::move(ipv6Addresses),
+             staticNameServers = std::move(staticNameServers)](
                 const bool &success, const EthernetInterfaceData &ethData,
                 const boost::container::flat_set<IPv4AddressData> &ipv4Data) {
                 if (!success)
@@ -1329,6 +1358,12 @@
                     messages::propertyNotWritable(asyncResp->res,
                                                   "IPv6Addresses");
                 }
+
+                if (staticNameServers)
+                {
+                    handleStaticNameServersPatch(iface_id, *staticNameServers,
+                                                 asyncResp);
+                }
             });
     }
 };
