diff --git a/scapy/config.py b/scapy/config.py
index 19c74b3d00cbfa305f2dff16e6160eaa811a3f2d..6c32d6d61bf64c2207572f739d9c0e57ae72ccfc 100755
--- a/scapy/config.py
+++ b/scapy/config.py
@@ -346,7 +346,9 @@ extensions_paths: path or list of paths where extensions are to be looked for
     L2socket = None
     L2listen = None
     min_pkt_size = 60
-    histfile = os.path.join(os.path.expanduser("~"), ".scapy_history")
+    histfile = os.getenv('SCAPY_HISTFILE',
+                         os.path.join(os.path.expanduser("~"),
+                                      ".scapy_history"))
     padding = 1
     except_filter = ""
     debug_match = 0