echo "nameserver 8.8.8.8"> /etc/resolv.conf




Download 7,3 Mb.
Pdf ko'rish
bet56/125
Sana14.05.2024
Hajmi7,3 Mb.
#232858
1   ...   52   53   54   55   56   57   58   59   ...   125
Bog'liq
linuxbasicsforhackers

echo "nameserver 8.8.8.8"> /etc/resolv.conf
This command echoes the string 
nameserver 8.8.8.8
and redirects it (
>

to the file 
/etc/resolv.conf
, replacing the current content. Your /etc/resolv.conf 
file should now look like Figure 3-2.
Figure 3-2: Changing the 
resolv.conf
 file to specify Google’s DNS server
If you open the /etc/resolv.conf file now, you should see that it points the 
DNS requests to Google’s DNS server rather than your local DNS server. 
Your system will now go out to the Google public DNS server to resolve 
domain names to IP addresses. This can mean domain names take a little 
longer to resolve (probably milliseconds). Therefore, to maintain speed but 
keep the option of using a public server, you might want to retain the local 
DNS server in the resolv.conf file and follow it with a public DNS server. The 
operating system queries each DNS server listed in the order it appears in 
/etc/resolv.conf, so the system will only refer to the public DNS server if the 
domain name can’t be found in the local DNS server.
N O T E
 
If you’re using a DHCP address and the DHCP server provides a DNS setting, the 
DHCP server will replace the contents of the file when it renews the DHCP address.


36
Chapter 3
Mapping Your Own IP Addresses
A special file on your system called the hosts file also performs domain name–
IP address translation. The hosts file is located at /etc/hosts, and kind of as with 
DNS, you can use it to specify your own IP address–domain name mapping. 
In other words, you can determine which IP address your browser goes to 
when you enter www.microsoft.com (or any other domain) into the browser, 
rather than let the DNS server decide. As a hacker, this can be useful for 
hijacking a TCP connection on your local area network to direct traffic to a 
malicious web server with a tool such as 
dnsspoof
.
From the command line, type in the following command (you can sub-
stitute your preferred text editor for 
leafpad
):
kali >

Download 7,3 Mb.
1   ...   52   53   54   55   56   57   58   59   ...   125




Download 7,3 Mb.
Pdf ko'rish

Bosh sahifa
Aloqalar

    Bosh sahifa



echo "nameserver 8.8.8.8"> /etc/resolv.conf

Download 7,3 Mb.
Pdf ko'rish