---
title: "Comment by c-wind on \" What Really Happens When You Run curl google.com on Linux?\" | Hashnode"
description: "The strace in section 1 is the tell: read(0, \"c\", 1) means the shell already has decoded characters on the pts slave. A terminal emulator writes those bytes to"
url: "https://hashnode.com/posts/what-really-happens-when-you-run-curl-google-com-on-linux/6add92ffd4e3b250db5e28a9/comment/6ade01fc5819f19be2dda65b"
---

[Discussion](https://hashnode.com/posts/what-really-happens-when-you-run-curl-google-com-on-linux/6add92ffd4e3b250db5e28a9)

Comment [What Really Happens When You Run curl google.com on Linux?](https://hashnode.com/posts/what-really-happens-when-you-run-curl-google-com-on-linux/6add92ffd4e3b250db5e28a9)

[c-wind](https://hashnode.com/@c-wind)

[Oct 25](https://hashnode.com/posts/what-really-happens-when-you-run-curl-google-com-on-linux/6add92ffd4e3b250db5e28a9/comment/6ade01fc5819f19be2dda65b)

The strace in section 1 is the tell: read(0, "c", 1) means the shell already has decoded characters on the pts slave. A terminal emulator writes those bytes to the pty master; it does not push scan codes across /dev/pts. Scan codes die in the local keyboard stack (evdev), and over SSH the remote pty only sees the channel bytes. The rest of that section (alias/hash, PATH stat loop, clone + execve, parent in wait4) matches what I see.

Smaller one in the resolver section: \[NOTFOUND=return\] after mdns4\_minimal is not "try mDNS, then DNS if missing." nss-mdns returns UNAVAIL for non-.local names so glibc continues to dns, and NOTFOUND only for .local misses, which is why those stop instead of leaking to the upstream resolver. The 301 walk-through is the part that is easy to get wrong and this one doesn't: Location stays on the www host, still plain HTTP, and -L is what starts the second hop onto HTTPS.

[Asep Sayyad](https://hashnode.com/@asepsayyad007)

[Oct 25](https://hashnode.com/posts/what-really-happens-when-you-run-curl-google-com-on-linux/6add92ffd4e3b250db5e28a9/comment/6ade01fc5819f19be2dda65b#reply-6ade0fd1c49e4c03682d0e00)

Thanks for such a detailed read! The distinction between terminal input and keyboard scan codes is an important detail, and the explanation of how `nss-mdns` interacts with DNS makes the resolver section even more interesting. Glad you also found the HTTP-to-HTTPS redirect walkthrough accurate. Really appreciate you sharing these insights!
