Ubuntu: Configure client-side DNS?


I have a network with 2 machines. machine A has IP , machine B has IP Now i want to resolve machine B IP address to test. I don't want to pass through a dns server. Instead I want to modify /etc/hosts, /etc/resolv.conf ... so that when I type "test" on machine's A browser, I am directed to machine B . Is this approach feasible and if yes, how.


Edit you /etc/hosts and below put like fallow

sudo nano /etc/hosts       localhost       xxx.yyy.com        xxx    # The following lines are desirable for IPv6 capable hosts  ::1     ip6-localhost ip6-loopback  fe00::0 ip6-localnet  ff00::0 ip6-mcastprefix  ff02::1 ip6-allnodes  ff02::2 ip6-allrouters    test  


You can do this by modifying Machine A's /etc/hosts file.

Open the file and add the following:  test    

Now you can reach Machine B by just using hostname test, you can also add an alias like:  test  machine-b  

Also make sure the /etc/nsswitch.conf file's hosts database lookup starts with the files data source. For example, in my computer:

hosts:          files mdns4_minimal [NOTFOUND=return] dns  

This means that while doing hostname resolution the relevant files in the /etc directory will be checked first.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »


Write comments
Aaron Cross
24 August 2017 at 02:11 delete

Hi, I'm Aaron, I had my friend help me hack my ex's email cause I suspected he was cheating. All he asked for was a his phone number. Contact him now, his email is hackerresolution@gmail.com..If you need help tell him Aaron referred you and he'll assist. At first I did not give it much thought, but my mind was still bothered so I decided to contact the hackerresolution@gmail.com to help me catch my cheating spouse. He delivered as was promised he is really a genius,he also does P.I jobs, clears your record, passwords,I love him and his work. You should try. Good luck