The following steps assume that you have a static local ip address, and you know your dns server settings as well as what your default gateway should be. If you need to setup your ip address, it can be done using the ifconfig
eg :
ifconfig pcn0 192.168.2.100
to set interface pcn0 to ip address 192.168.2.100
There are other options as well for which you can consult the man pages for ifconfig.
man ifconfig
- Create a file called /etc/resolv.conf its contents should be :
nameserver 192.168.2.2
Where 192.168.2.1 and 192.168.2.2 are your primary and secondary dns servers.
2. Either copy /etc/nsswitch.dns to /etc/nsswitch.conf
or
edit /etc/nsswitch.conf to change the line that says
hosts: file to hosts: file dns
3. Add a default route or gateway using the following command:
route add 192.168.2.254 0.0.0.0
Where 192.168.2.254 is your default gateway.
At this point you should be able to access the internet using hostnames rather than ip addresses. ie: your DNS settings should be working now.
2 comments:
Thanks very much bro
Thanks!!!
Post a Comment