Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Dec 042010
 

Simple port forwarding using SSH

Answer:

Assume you are working at office, you want to browse the example.com securely, you can do so by using a computer at home (e.g. HOME_IP)to build a secure tunnel using ssh.

# sudo ssh -L 80:example.com:80 HOME_IP

Then in your browser, type http://localhost and you can view the example.com securely.

Dec 032010
 

Determine file type using the file command

Answer:

If you want to determine file type, you can try the file command:

# file /usr/share/perl5/Time/Zone.pm
/usr/share/perl5/Time/Zone.pm: Perl5 module source text

# file /usr/share/vim/vim72/doc/usr_90.txt
/usr/share/vim/vim72/doc/usr_90.txt: ASCII English text
Nov 302010
 

Show the Domain Name Servers for a domain

Answer:

To show the Domain Name Servers for a domain, use the command below:

E.g. example.com

# nslookup -type=ns example.com
Server:         203.98.160.11
Address:        203.98.160.11#53

Non-authoritative answer:
example.com     nameserver = b.iana-servers.net.
example.com     nameserver = a.iana-servers.net.

Authoritative answers can be found from:
a.iana-servers.net      internet address = 192.0.34.43
b.iana-servers.net      internet address = 193.0.0.236
b.iana-servers.net      has AAAA address 2001:610:240:2::c100:ec