Index: src/fping.c
--- src/fping.c.orig
+++ src/fping.c
@@ -483,6 +483,9 @@ int main(int argc, char **argv)
     struct sigaction act;
 #endif
 
+    if (pledge("stdio inet rpath dns id", NULL) == -1)
+        perror("pledge");
+
     /* pre-parse -h/--help, so that we also can output help information
      * without trying to open the socket, which might fail */
     prog = argv[0];
@@ -519,6 +522,10 @@ int main(int argc, char **argv)
     }
 
     optparse_init(&optparse_state, argv);
+
+    if (pledge("stdio inet rpath dns id", NULL) == -1)
+        perror("pledge");
+
     ident4 = ident6 = htons(getpid() & 0xFFFF);
     verbose_flag = 1;
     backoff_flag = 1;
@@ -938,6 +945,11 @@ int main(int argc, char **argv)
         exit(4);
     }
 
+    if (!filename) { /* drop rpath if not reading addrs from file */
+        if (pledge("stdio inet dns", NULL) == -1)
+            perror("pledge");
+    }
+
     /* validate various option settings */
 
 #ifndef IPV6
@@ -1212,6 +1224,10 @@ int main(int argc, char **argv)
     if (!num_hosts) {
         exit(num_noaddress ? 2 : 1);
     }
+
+    /* finished with file and dns/rdns lookups */
+    if (pledge("stdio inet", NULL) == -1)
+        perror("pledge");
 
     if (socket4 >= 0 && (src_addr_set || socktype4 == SOCK_DGRAM)) {
         socket_set_src_addr_ipv4(socket4, &src_addr, (socktype4 == SOCK_DGRAM) ? &ident4 : NULL);
