How to change DNS servers

In both linux and Solaris and possibly other UNIX’es you can change your dhcp servers simply by editing your /etc/resolv.conf

It should look like below.

search domain.com otherdomain.com
nameserver 192.168.0.1
nameserver 192.168.0.2

The nameserver’s or DNS server will try to be connected to in order from top to bottom. The search domains do not matter if they are at the top or bottom. Search domains are usefull if you dont want to have to type in the whole FQDN (Fully Qualified Domain Name). So instead of typing in “ping sparky.domain.com” you can shorten it to “ping sparky”.

Comments (1)

How to mount a usb drive in linux

So you just inserted your USB stick/drive into your Linux Workstation/D3esktop/Laptop and it did not automatically mount it. What to do? Well the first thing to do would be to make sure it is not really mounted but running, you guessed it right the “mount” command.

bab@mini:~$ mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)

Aha yup, looks like there are no usb

Comments

How to renew your dhcp lease in linux

root@client:~# dhclient eth0
There is already a pid file /var/run/dhclient.pid with pid 4478
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth0/00:22:cb:ze:95:sh
Sending on   LPF/eth0/00:22:cb:ze:95:sh
Sending on   Socket/fallback
DHCPREQUEST of 192.168.0.101 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.0.101 from 192.168.0.1
bound to 192.168.0.101 — renewal in 284384 seconds.
root@client:~#

You could want to restart your leas for a variety of reasons.  You just set up a static DHCP lease and you want to computer to pick up the new ip.  If you are logged in via SSH make sure when you connection is dropped that you know what the new ip will be before hand or at least have a log in to the router so you can find out what it was assigned.

Comments

How to change the mac address in Linux

# ifconfig eth0 down
# ifconfig eth0 hw ether 00:80:48:BA:d1:20
# ifconfig eth0 up
# ifconfig eth0 |grep HWaddr

This is always fun to do.  Why might you want to do this.  Say your friend paid for internet access at at coffee shop.  Your friend leaves early.  You change your mac to what his mac is and then you can freely surf the internet with out paying.  Kind of like using a parking meeter that still has time on it :>

Comments

SDS (Solstice DiskSuite) Replacing a failed disk

1. Detach each submirror

ex. metadetach -f d0 d20
d0: submirror d20 is detached

2. Clear each submirror

ex. metaclear d20
d20: Concat/Stripe is cleared

3. Delete the db replica on the failed drive (you can find the replica output by issuing metadb command with no arguments):

ex. metadb -d c0t2d0s7

4. Remove failed drive. Replace with new drive.

5. Run the format command and place the correct partition table, using the layout of the non-replaced drive.

6. re-create the metadb replica on the new disk

ex. metadb -a c0t2d0s7

7. Run metainit for each replaced submirror

ex. metainit d21 1 1 c0t2d0s1
d21: Concat/Stripe is setup

8. Run metattach for each submirror

ex. metattach d0 d20
d0: submirror d20 is attached

ex. metattach d1 d21
d1: submirror d21 is attached

Comments (2)

« Previous entries