strace Use Example - The Networked Client (Cont.) We now open the '/etc/host.conf' file - to know how to perform host name lookup: open("/etc/host.conf", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=17, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40013000 read(3, "order hosts,bind\n", 4096) = 17 read(3, "", 4096) = 0 close(3) = 0 munmap(0x40013000, 4096) = 0 We were told to consult '/etc/hosts' first (see the 'read' above) - lets do that: open("/etc/hosts", O_RDONLY) = 3 fcntl64(3, F_GETFD) = 0 fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 fstat64(3, {st_mode=S_IFREG|0644, st_size=230, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40013000 read(3, "127.0.0.1\t\tlocalhost\n204.141.72."..., 4096) = 230 read(3, "", 4096) = 0 close(3) = 0 munmap(0x40013000, 4096) = 0