NSNTRACE(1)

✨ NSNTRACE(1) β€” the nsntrace manual, but make it cute ✨

okay bestie, sit down, hydrate, and let me tell you about nsntrace from the nsntrace manual. she does network traces of a process using Linux network namespaces and honestly? iconic. πŸ’…


🌸 NAME 🌸

nsntrace β€” do a network trace of a process by using Linux network namespaces πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

nsntrace [options] program [arguments]

like. that's it. that's the whole vibe. options first, then the program you're tracing, then whatever arguments that program wants. ✨


πŸ’– DESCRIPTION πŸ’–

so the tea is: nsntrace uses Linux network namespaces to perform network traces of the program you picked. the traces get stored as pcap files, and later you can analyze them with applications like wireshark. she's giving forensic scientist, she's giving main character energy. πŸ”₯

here's the lowkey genius part: nsntrace creates a new network namespace and launches the specified program inside it. this makes sure every single packet we trace actually comes from the system or from the program you specified. no stray packets crashing the party. 🫢

now, network namespaces are super isolated (as they should be πŸ’…), and to get around that isolation a virtual network interface gets created. and so that the program's network traffic can actually reach the root network namespace, iptables is used. yeah, the whole thing is a little network plumbing situation and it works. obsessed.

πŸ‘‘ real talk though: because nsntrace uses iptables and traces raw sockets, it needs to be run as root. no getting around it, bestie. sudo up. 😭

✨ OPTIONS ✨

the following options are understood. yes, all of them. here we go:

  • --device dev, -d dev β€” the network device to use in the trace. pick your interface, diva. 🌈
  • --use-public-dns β€” override resolv.conf in the namespace so it uses public nameservers from Quad9 (9.9.9.9), Cloudflare (1.1.1.1), Google (8.8.8.8) and OpenDNS (208.67.222.222). DNS drama? not today. ✨
  • --outfile file, -o file β€” write the trace output to the file file. the default is nsntrace.pcap. and if you pass '-' she writes to stdout instead. flexible queen. πŸ’œ
  • --user user, -u user β€” run program with the user ID, group ID and supplementary groups of user. dropping privileges, we love to see it. πŸŽ€
  • --filter filter, -f filter β€” the capture filter to use while capturing. for filter syntax, go check out pcap-filter(7). iykyk. πŸ¦‹

πŸ’€ EXIT STATUS πŸ’€

on success, 0 is returned. otherwise, a non-zero failure code is returned. so if you get a zero, she ate. if you don't, something went sideways and that's your sign. 🫢


🌟 AUTHOR 🌟

Jonas Danielsson <jonas@threetimestwo.org>

  • original author πŸ’–

and that's the whole page, bestie! this was the nsntrace manual, dated 05/25/2026, from the nsntrace source. go trace something (as root, pls) and slay responsibly. periodt. πŸ‘‘βœ¨πŸ’…

πŸ“¦ where this page comes from