diff --git a/src/transport/unix-transport.cpp b/src/transport/unix-transport.cpp
index 4da0502..84424f3 100644
--- a/src/transport/unix-transport.cpp
+++ b/src/transport/unix-transport.cpp
@@ -10,6 +10,7 @@
 #include "unix-transport.hpp"
 
 #include "../face.hpp"
+#include <cstdlib>
 
 using namespace std;
 typedef boost::asio::local::stream_protocol protocol;
@@ -70,7 +71,7 @@
     socket_.close();
     throw Transport::Error(error, "error while connecting to the forwarder");
   }
-  
+
   void
   connect()
   {
@@ -81,14 +82,14 @@
       /// @todo Decide whether this number should be configurable
       connectTimer_.expires_from_now(boost::posix_time::seconds(4));
       connectTimer_.async_wait(func_lib::bind(&Impl::connectTimeoutHandler, this, _1));
-      
+
       socket_.open();
       socket_.async_connect(protocol::endpoint(transport_.unixSocket_),
                             func_lib::bind(&Impl::connectHandler, this, _1));
     }
   }
 
-  void 
+  void
   close()
   {
     connectTimer_.cancel();
@@ -96,8 +97,8 @@
     transport_.isConnected_ = false;
   }
 
-  void 
-  send(const Block &wire)
+  void
+  send(const Block& wire)
   {
     if (!transport_.isConnected_)
       sendQueue_.push_back(wire);
@@ -107,7 +108,7 @@
   }
 
   inline void
-  processAll(uint8_t *buffer, size_t &offset, size_t availableSize)
+  processAll(uint8_t* buffer, size_t& offset, size_t availableSize)
   {
     while(offset < availableSize)
       {
@@ -117,7 +118,7 @@
         offset += element.size();
       }
   }
-  
+
   void
   handle_async_receive(const boost::system::error_code& error, std::size_t bytes_recvd)
   {
@@ -129,12 +130,12 @@
           // async receive has been explicitly cancelled (e.g., socket close)
           return;
         }
-        
+
         socket_.close(); // closing at this point may not be that necessary
         transport_.isConnected_ = true;
         throw Transport::Error(error, "error while receiving data from socket");
       }
-    
+
     if (!error && bytes_recvd > 0)
       {
         // inputBuffer_ has bytes_recvd received bytes of data
@@ -144,7 +145,7 @@
             std::copy(inputBuffer_, inputBuffer_ + newDataSize, partialData_ + partialDataSize_);
 
             partialDataSize_ += newDataSize;
-              
+
             size_t offset = 0;
             try
               {
@@ -154,7 +155,7 @@
                 if (bytes_recvd - newDataSize > 0)
                   {
                     // there is a little bit more data available
-                        
+
                     offset = 0;
                     partialDataSize_ = bytes_recvd - newDataSize;
                     std::copy(inputBuffer_ + newDataSize, inputBuffer_ + newDataSize + partialDataSize_, partialData_);
@@ -213,10 +214,10 @@
   {
     // pass (needed to keep data block alive during the send)
   }
-  
+
 private:
   UnixTransport &transport_;
-  
+
   protocol::socket socket_;
   uint8_t inputBuffer_[MAX_LENGTH];
 
@@ -229,7 +230,16 @@
   boost::asio::deadline_timer connectTimer_;
 };
 
-UnixTransport::UnixTransport(const std::string &unixSocket/* = "/tmp/.ndnd.sock"*/) 
+
+UnixTransport::UnixTransport()
+{
+  if (std::getenv("NFD") != 0)
+      unixSocket_ = "/var/run/nfd.sock";
+  else
+      unixSocket_ = "/tmp/.ndnd.sock";
+}
+
+UnixTransport::UnixTransport(const std::string& unixSocket)
   : unixSocket_(unixSocket)
 {
 }
@@ -238,25 +248,25 @@
 {
 }
 
-void 
-UnixTransport::connect(boost::asio::io_service &ioService,
-                       const ReceiveCallback &receiveCallback)
+void
+UnixTransport::connect(boost::asio::io_service& ioService,
+                       const ReceiveCallback& receiveCallback)
 {
   if (!static_cast<bool>(impl_)) {
     Transport::connect(ioService, receiveCallback);
-  
+
     impl_ = ptr_lib::make_shared<UnixTransport::Impl> (ptr_lib::ref(*this));
   }
   impl_->connect();
 }
 
-void 
-UnixTransport::send(const Block &wire)
+void
+UnixTransport::send(const Block& wire)
 {
   impl_->send(wire);
 }
 
-void 
+void
 UnixTransport::close()
 {
   impl_->close();
diff --git a/src/transport/unix-transport.hpp b/src/transport/unix-transport.hpp
index 26621d7..dc85eac 100644
--- a/src/transport/unix-transport.hpp
+++ b/src/transport/unix-transport.hpp
@@ -12,24 +12,26 @@
 #include "transport.hpp"
 
 namespace ndn {
-  
+
 class UnixTransport : public Transport
 {
 public:
-  UnixTransport(const std::string &unixSocket = "/tmp/.ndnd.sock");
+  UnixTransport();
+
+  UnixTransport(const std::string& unixSocket);
   ~UnixTransport();
 
   // from Transport
-  virtual void 
-  connect(boost::asio::io_service &ioService,
-          const ReceiveCallback &receiveCallback);
-  
-  virtual void 
+  virtual void
+  connect(boost::asio::io_service& ioService,
+          const ReceiveCallback& receiveCallback);
+
+  virtual void
   close();
 
-  virtual void 
-  send(const Block &wire);
-  
+  virtual void
+  send(const Block& wire);
+
 private:
   std::string unixSocket_;
 
