Index: src/preferences/network/EthernetSettingsView.h
===================================================================
--- src/preferences/network/EthernetSettingsView.h	(revision 35928)
+++ src/preferences/network/EthernetSettingsView.h	(working copy)
@@ -6,6 +6,7 @@
  *		Andre Alves Garzia, andre@andregarzia.com
  *		Axel Dörfler
  *		Hugo Santos
+ *		Vegard Wærp
  */
 #ifndef ETHERNET_SETTINGS_VIEW_H
 #define ETHERNET_SETTINGS_VIEW_H
@@ -65,6 +66,7 @@
 
 				BTextControl*	fPrimaryDNSTextControl;
 				BTextControl*	fSecondaryDNSTextControl;
+				BTextControl*	fDomainTextControl;
 
 				BStringView*	fErrorMessage;
 
Index: src/preferences/network/Settings.cpp
===================================================================
--- src/preferences/network/Settings.cpp	(revision 35928)
+++ src/preferences/network/Settings.cpp	(working copy)
@@ -5,6 +5,7 @@
  * Authors:
  *		Andre Alves Garzia, andre@andregarzia.com
  *		Axel Dörfler, axeld@pinc-software.de.
+ *		Vegard Wærp, vegarwa@online.no
  */
 
 
@@ -159,5 +160,6 @@
 			fNameServers.AddItem(
 				new BString(inet_ntoa(state->nsaddr_list[i].sin_addr)));
 		}
+		fDomain = state->dnsrch[0];
 	}
 }
Index: src/preferences/network/Settings.h
===================================================================
--- src/preferences/network/Settings.h	(revision 35928)
+++ src/preferences/network/Settings.h	(working copy)
@@ -2,8 +2,9 @@
  * Copyright 2004-2009 Haiku Inc. All rights reserved.
  * Distributed under the terms of the MIT License.
  *
- * Author:
+ * Authors:
  *		Andre Alves Garzia, andre@andregarzia.com
+ *		Vegard Wærp, vegarwa@online.no
  */
 #ifndef SETTINGS_H
 #define SETTINGS_H
@@ -21,6 +22,7 @@
 			void				SetIP(BString ip) { fIP = ip; }
 			void				SetGateway(BString ip) { fGateway = ip; }
 			void				SetNetmask(BString ip) { fNetmask = ip; }
+			void				SetDomain(BString domain) { fDomain = domain; }
 			void				SetAutoConfigure(bool autoConfigure)
 									{ fAuto = autoConfigure; }
 
@@ -28,6 +30,7 @@
 			const char*			Gateway()  { return fGateway.String(); }
 			const char*			Netmask()  { return fNetmask.String(); }
 			const char*			Name()  { return fName.String(); }
+			const char*			Domain() { return fDomain.String(); }
 			bool				AutoConfigure() { return fAuto; }
 
 			BObjectList<BString>& NameServers() { return fNameServers; }
@@ -41,6 +44,7 @@
 			BString				fGateway;
 			BString				fNetmask;
 			BString				fName;
+			BString				fDomain;
 			int					fSocket;
 			bool				fAuto;
 			BObjectList<BString> fNameServers;
Index: src/preferences/network/EthernetSettingsView.cpp
===================================================================
--- src/preferences/network/EthernetSettingsView.cpp	(revision 35928)
+++ src/preferences/network/EthernetSettingsView.cpp	(working copy)
@@ -8,6 +8,7 @@
  *		Axel Dörfler
  *		Hugo Santos
  *		Philippe Saint-Pierre
+ *		Vegard Wærp
  */
 
 
@@ -172,12 +173,17 @@
 	layout->AddItem(fSecondaryDNSTextControl->CreateLabelLayoutItem(), 0, 6);
 	layout->AddItem(fSecondaryDNSTextControl->CreateTextViewLayoutItem(), 1, 6);
 
+	fDomainTextControl = new BTextControl(TR("Domain:"), "", NULL);
+	SetupTextControl(fDomainTextControl);
+	layout->AddItem(fDomainTextControl->CreateLabelLayoutItem(), 0, 7);
+	layout->AddItem(fDomainTextControl->CreateTextViewLayoutItem(), 1, 7);
+
 	fErrorMessage = new BStringView("error", "");
 	fErrorMessage->SetAlignment(B_ALIGN_LEFT);
 	fErrorMessage->SetFont(be_bold_font);
 	fErrorMessage->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
 
-	layout->AddView(fErrorMessage, 1, 7);
+	layout->AddView(fErrorMessage, 1, 8);
 
 	// button group (TODO: move to window, but take care of
 	// enabling/disabling)
@@ -268,6 +274,7 @@
 	fGatewayTextControl->SetTarget(this);
 	fPrimaryDNSTextControl->SetTarget(this);
 	fSecondaryDNSTextControl->SetTarget(this);
+	fDomainTextControl->SetTarget(this);
 	fDeviceMenuField->Menu()->SetTargetForItems(this);
 	fTypeMenuField->Menu()->SetTargetForItems(this);
 
@@ -293,6 +300,7 @@
 	fNetMaskTextControl->SetText("");
 	fPrimaryDNSTextControl->SetText("");
 	fSecondaryDNSTextControl->SetText("");
+	fDomainTextControl->SetText("");
 
 	bool enableControls = false;
 	fTypeMenuField->SetEnabled(settings != NULL);
@@ -325,6 +333,7 @@
 			fPrimaryDNSTextControl->SetText(
 				settings->NameServers().ItemAt(0)->String());
 		}
+		fDomainTextControl->SetText(settings->Domain());
 	}
 
 	_EnableTextControls(enableControls);
@@ -339,6 +348,7 @@
 	fNetMaskTextControl->SetEnabled(enable);
 	fPrimaryDNSTextControl->SetEnabled(enable);
 	fSecondaryDNSTextControl->SetEnabled(enable);
+	fDomainTextControl->SetEnabled(enable);
 }
 
 
@@ -360,6 +370,7 @@
 		fPrimaryDNSTextControl->Text()));
 	fCurrentSettings->NameServers().AddItem(new BString(
 		fSecondaryDNSTextControl->Text()));
+	fCurrentSettings->SetDomain(fDomainTextControl->Text());
 
 	fApplyButton->SetEnabled(false);
 	fRevertButton->SetEnabled(true);
@@ -404,6 +415,11 @@
 					<< "\n";
 			}
 		}
+		if (strlen(settings->Domain()) > 0) {
+			content << "domain\t"
+				<< settings->Domain()
+				<< "\n";
+		}
 	}
 
 	file.Write(content.String(), content.Length());
Index: src/servers/net/DHCPClient.cpp
===================================================================
--- src/servers/net/DHCPClient.cpp	(revision 35928)
+++ src/servers/net/DHCPClient.cpp	(working copy)
@@ -4,6 +4,7 @@
  *
  * Authors:
  *		Axel Dörfler, axeld@pinc-software.de
+ *		Vegard Wærp, vegarwa@online.no
  */
 
 
@@ -681,6 +682,18 @@
 				memcpy(name, data, size);
 				name[size] = '\0';
 				syslog(LOG_INFO, "DHCP domain name: \"%s\"\n", name);
+
+				BPath path;
+				if (find_directory(B_COMMON_SETTINGS_DIRECTORY, &path) != B_OK)
+					break;
+	
+				path.Append("network/resolv.conf");
+
+				FILE* file = fopen(path.Path(), "a");
+				if (file != NULL) {
+					fprintf(file, "domain %s\n", name);
+				}
+				fclose(file);
 				break;
 			}
 
