May 28, 2007

几个Logo

http://googlealive.com/create.asp生成的几个Logo,挺有意思。

什么是A记录?什么是别名记录(CNAME)?什么是MX记录?什么是NS记录?

From:http://help.zzy.cn/info.asp?id=30


A (Address) 记录

是用来指定主机名(或域名)对应的IP地址记录。用户可以将该域名下的网站服务器指向到自己的web server上。同时也可以设置您域名的二级域名。

 

别名记录(CNAME)

也被称为规范名字。这种记录允许您将多个名字映射到同一台计算机。
通常用于同时提供WWW和MAIL服务的计算机。例如,有一台计算机名为“host.mydomain.com”(A记录)。
它同时提供WWW和MAIL服务,为了便于用户访问服务。可以为该计算机设置两个别名(CNAME):WWW和MAIL。
这两个别名的全称就是“www.mydomain.com”和“mail.mydomain.com”。实际上他们都指向
“host.mydomain.com”。
同样的方法可以用于当您拥有多个域名需要指向同一服务器IP,此时您就可以将一个域名做A记录指向服务器IP然后将其他的域名做别名到之前做A记录的域名
上,那么当您的服务器IP地址变更时您就可以不必麻烦的一个一个域名更改指向了
只需要更改做A记录的那个域名其他做别名的那些域名的指向也将自动更改到新的IP地址上了。

 

MX(Mail Exchanger)记录

是邮件交换记录,它指向一个邮件服务器,用于电子邮件系统发邮件时根据
收信人的地址后缀来定位邮件服务器。例如,当Internet上的某用户要发一封信给 user@mydomain.com
时,该用户的邮件系统通过DNS查找mydomain.com这个域名的MX记录,如果MX记录存在,
用户计算机就将邮件发送到MX记录所指定的邮件服务器上。

检查MX记录是否存在的方法
     进行DNS查询的一个非常有用的工具是nslookup,可以使用它来查询DNS中的各种数据。可以在Windows的命令行下直接运行nslookup进入一个交互模式,在这里能查询各种类型的DNS数据。
 
   DNS的名字解析数据可以有各种不同的类型,有设置这个zone的参数的SOA类型数据,有设置名字对应的IP地址的A类型数据,有设置邮件交换的
MX类型数据。这些不同类型的数据均可以通过nslookup的交互模式来查询,在查询过程中可以使用 set type命令设置相应的查询类型。
如:
C:>nslookup
Default Server: [202.106.184.166]
Address: 202.106.184.166

> set type=mx
> sina.com.cn
Default Server: [202.106.184.166]
Address: 202.106.184.166

Non-authoritative answer:
sina.com.cn MX preference = 10, mail exchanger = sinamx.sina.com.cn

sina.com.cn nameserver = ns1.sina.com.cn
sina.com.cn nameserver = ns3.sina.com.cn
sinamx.sina.com.cn internet address = 202.106.187.179
sinamx.sina.com.cn internet address = 202.106.182.230
ns1.sina.com.cn internet address = 202.106.184.166
ns3.sina.com.cn internet address = 202.108.44.55


如果所要查的某域名的MX记录不存在,则出现与以下类似的提示:
C:>nslookup
> set type=mx
> amafdsfxit.com.cn
Default Server: [202.106.184.166]
Address: 202.106.184.166

*** 202.106.184.166 can't find amaxit.com.cn: Non-existent domain

简单技巧:同时也可使用 nsloolup -qt=mx zzy.cn 这样的命令来查询zzy.cn的MX记录。

附:中资源企业邮局MX记录做法
单线企业邮局(电信单线路):mx1.cnm.cn.
双线企业邮局(电信+网通同时具有线路):mx2.cnm.cn.

 

NS(Name Server)记录

是域名服务器记录,用来指定该域名由哪个DNS服务器来进行解析。

使用Nslookup.exe

From: http://support.microsoft.com/kb/200525



概要


Nslookup.exe 是命令行管理工具,用于测试或解决 DNS 服务器问题。此工具是通过“控制面板”与 TCP/IP 协议一起安装的。本文包含使用 Nslookup.exe 的若干提示。

更多信息


要使用 Nslookup.exe,请注意以下方面:

TCP/IP 协议必须安装在运行 Nslookup.exe 的计算机上。

Microsoft TCP/IP 属性页的 DNS 选项卡的“DNS 服务搜索顺序”字段中必须至少指定一个 DNS 服务器。

Nslookup
一直从当前上下文中的名称中抽去后缀。如果无法进行完全合格的名称查询(即,使用尾随点),那么查询将被附加到当前上下文中。例如,当前 DNS
设置是 att.com,并且在 www.microsoft.com 中执行查询,那么第一个查询将作为
www.microsoft.com.att.com 而失败,因为查询是不合格的。
这种方式与其他供应商的 Nslookup 方式可能不一致,本文的目的在于阐明 Microsoft Windows NT
Nslookup.exe 的处理方式。

如果已经使用 Microsoft TCP/IP 属性DNS 选项卡上定义的“域后缀搜索顺序”(Domain Suffix Search Order )中的搜索列表,将不会发生抽取操作。查询将被附加到列表中指定的域后缀中。要避免使用搜索列表,请始终使用“完全合格的域名称”(即,在名称中添加尾随点)。


Nslookup.exe 可以在两种模式下运行:交互式和非交互式。
当需要返回单块数据时,请使用非交互式模式。非交互模式的语法如下:


   nslookup [-option] [hostname] [server]


要在交互模式下启动 Nslookup.exe,只需在命令提示符下输入 nslookup:


   C:> nslookup
Default Server: nameserver1.domain.com
Address: 10.0.0.1
>


在命令提示符下输入 help 或 ? 将生成可用的命令列表。
在命令提示符下输入的任何内容,如果它不是有效命令,则假设它是主机名,尝试使用默认服务器来解析它。要中断交互命令,请按 CTRL+C。要退出交互模式并返回到命令提示符下,并在命令提示符下输入 exit



以下是帮助输出,其中包含选项的完整列表:


Commands:   (identifiers are shown in uppercase, [] means optional)

NAME - print info about the host/domain NAME using default
server
NAME1 NAME2 - as above, but use NAME2 as server
help or ? - print info on common commands
set OPTION - set an option

all - print options, current server and host
[no]debug - print debugging information
[no]d2 - print exhaustive debugging information
[no]defname - append domain name to each query
[no]recurse - ask for recursive answer to query
[no]search - use domain search list
[no]vc - always use a virtual circuit
domain=NAME - set default domain name to NAME
srchlist=N1[/N2/.../N6] - set domain to N1 and search list to N1, N2,
and so on
root=NAME - set root server to NAME
retry=X - set number of retries to X
timeout=X - set initial time-out interval to X seconds
type=X - set query type (for example, A, ANY, CNAME, MX,
NS, PTR, SOA, SRV)
querytype=X - same as type
class=X - set query class (for example, IN (Internet), ANY)
[no]msxfr - use MS fast zone transfer
ixfrver=X - current version to use in IXFR transfer request

server NAME - set default server to NAME, using current default server
lserver NAME - set default server to NAME, using initial server
finger [USER] - finger the optional NAME at the current default host
root - set current default server to the root
ls [opt] DOMAIN [> FILE] - list addresses in DOMAIN (optional: output to
FILE)

-a - list canonical names and aliases
-d - list all records
-t TYPE - list records of the given type (for example, A, CNAME,
MX, NS, PTR, and so on)

view FILE - sort an 'ls' output file and view it with pg
exit - exit the program


通过在命令提示符下运行 set 命令,可以在 Nslookup.exe 中设置许多不同的选项。要得到这些选项的完整列表,只需输入 set all。请参见以上内容,在 set 命令下,得到可用选项的打印输出。




查找不同的数据类型




要在域名空间中查找不同的数据类型,请在命令提示符下使用 set typeset q[uerytype] 命令。例如,要查询邮件交换器数据,请输入:

   C:> nslookup
Default Server: ns1.domain.com
Address: 10.0.0.1

> set q=mx
> mailhost
Server: ns1.domain.com
Address: 10.0.0.1

mailhost.domain.com MX preference = 0, mail exchanger =
mailhost.domain.com
mailhost.domain.com internet address = 10.0.0.5
>


第一次查询是查找远程名称,答案是权威的,但随后的查询是非权威的。第一次查询远程主机时,本地 DNS 服务器与作为该域权威的 DNS 服务器取得联系。然后,本地 DNS 服务器缓存该信息,以便从本地服务器缓存中非权威地回答随后的查询。



直接从另一个名称服务器中进行查询




要直接查询另一个名称服务器,请使用 serverlserver 命令切换到该名称服务器。lserver 命令使用本地服务器得到要切换的服务器地址,而 server 命令使用当前默认服务器得到该地址。



例如:

   C:> nslookup

Default Server: nameserver1.domain.com
Address: 10.0.0.1

> server 10.0.0.2

Default Server: nameserver2.domain.com
Address: 10.0.0.2
>


使用 Nslookup.exe 转移整个区域




使用 ls 命令,Nslookup 可以用于转移整个区域。
查看远程域中的所有主机,这是有用的。ls 命令的语法如下:


   ls [- a | d | t type] domain [> filename]


不带参数使用 ls 命令将返回所有地址和名称服务器数据的列表。-a 参数将返回别名和正式名称,-d 将返回所有数据,而 -t 将按类型进行筛选。



例如:


   >ls domain.com
[nameserver1.domain.com]
nameserver1.domain.com. NS server = ns1.domain.com
nameserver2.domain.com NS server = ns2.domain.com
nameserver1 A 10.0.0.1
nameserver2 A 10.0.0.2

>


在 DNS 服务器中可以按块转移区域,以便只有授权的地址和网络才可以执行此操作。如果设置了区域安全,将返回以下错误消息:


*** Can't list domain example.com .: Query refused


有关其它信息,请参见以下 Microsoft Knowledge Base 文章:
193837 (http://support.microsoft.com/kb/193837/EN-US/) Windows NT 4.0 DNS 服务器默认区域安全设置



Nslookup.exe 的疑难解答




默认服务器超时




当启动 Nslookup.exe 工具时,以下错误可能出现:


*** Can't find server name for address w.x.y.z : Timed out

备注
w.x.y.z 是在“DNS 服务搜索顺序”列表中列出的第一个 DNS 服务器。



*** Can't find server name for address 127.0.0.1: Timed out


第一个错误指出不能连接 DNS 服务器,或者该计算机上的服务没有运行。要解决此问题,启动该服务器上的 DNS 服务,或检查可能存在的连接问题。



第二个错误指出在“DNS 服务搜索顺序”列表中还没有定义服务器。要解决此问题,请将有效 DNS 服务器的 IP 地址添加到此列表中。



有关其它信息,请参见以下 Microsoft Knowledge Base 文章:
172060 (http://support.microsoft.com/kb/172060/EN-US/) NSLOOKUP:找不到地址 127.0.0.1 的服务器名


启动 Nslookup.exe 时找不到服务器名




启动 Nslookup.exe 工具时,可能出现以下错误:



*** Can't find server name for address w.x.y.z: Non-existent domain



当没有名称服务器 IP 地址的 PTR 记录时,会出现此错误。当 Nslookup.exe 启动时,它执行反向搜索,以得到默认服务器的名称。如果没有 PTR 数据,则返回此错误消息。要解决此问题,请确保反向搜索区域存在,并包含名称服务器的 PTR 记录。



有关其它信息,请参见以下 Microsoft Knowledge Base 文章:
172953 (http://support.microsoft.com/kb/172953/EN-US/) 如何安装和配置 Microsoft DNS Server


Nslookup 在子域上无法执行




当在子域上执行查询或进行区域转移时,Nslookup 可能返回以下错误:



*** ns.domain.com can't find child.domain.com.: Non-existent domain

*** Can't list domain child.domain.com.: Non-existent domain


在 DNS Manager
中,可以在主区域下添加一个新域,这样就创建了一个子域。用这种方法创建子域并不为该域创建一个单独的 db
文件,这样在该域进行查询或在该域进行区域转移时将会产生以上错误。在父域上进行区域转移时将同时列出父域数据和子域数据。要解决此问题,请在 DNS
服务器上为该子域创建一个新主域。

nslookup 使用說明

     From:http://turtle.ee.ncku.edu.tw/~tung/dns/nslookup.html:


     有些時候, user 可能會想要手動查詢 DNS 上一些資料, 或者是要看看 DNS 是否有問題,
此時我們最常用的工具就是 nslookup 了, 基本上 nslookup 會根據 /etc/resolv.conf
的內容去找到所要使用的 local DNS server.

 

使用說明

打入 nslookup 命令後, 會看到 > 提示符號, 此時打 ? 就會出現 nslookup
說明

Default Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

>?

$Id: nslookup.help,v 8.4 1996/10/25 18:09:41 vixie
Exp $

Commands:      
(identifiers are shown in uppercase, [] means optional)


NAME           
- print info about the host/domain NAME using default server


NAME1 NAME2     - as above,
but use NAME2 as server


help or ?      
- print info on common commands; see nslookup(1) for details


set OPTION      - set
an option


    all        
- print options, current server and host


    [no]debug   - print
debugging information


    [no]d2     
- print exhaustive debugging information


    [no]defname - append domain
name to each query


    [no]recurse - ask for recursive
answer to query


    [no]vc     
- always use a virtual circuit


    domain=NAME - set default
domain name to NAME


    srchlist=N1[/N2/.../N6] -
set domain to N1 and search list to N1,N2, etc.


    root=NAME   - set
root server to NAME


    retry=X    
- set number of retries to X


    timeout=X   - set
initial time-out interval to X seconds


    querytype=X - set query type,
e.g., A,ANY,CNAME,HINFO,MX,PX,NS,PTR,SOA,TXT,WKS,SRV,NAPTR


    port=X     
- set port number to send query on


    type=X     
- synonym for querytype


    class=X    
- set query class to one of IN (Internet), CHAOS, HESIOD or ANY


server NAME     - set default
server to NAME, using current default server


lserver NAME    - set default
server to NAME, using initial server


finger [USER]   - finger the optional
USER at the current default host


root           
- set current default server to the root


ls [opt] DOMAIN [> FILE] - list addresses in
DOMAIN (optional: output to FILE)


    -a         
-  list canonical names and aliases


    -h         
-  list HINFO (CPU type and operating system)


    -s         
-  list well-known services


    -d         
-  list all records


    -t TYPE    
-  list records of the given type (e.g., A,CNAME,MX, etc.)


view FILE      
- sort an 'ls' output file and view it with more


exit           
- exit the program, ^D also exits


>^D

 

Interactive/Noninteractive (交談式/非交談式)

執行 nslookup 時可以直接在後面跟著我們要查詢的資料, 那麼 nslookup 會直接把結果傳回來

如果只打入 nslookup [enter], 則進入交談模式, 出現提示符號 >, 此時 nslookup
會等待 user input command.

tung@traveler:~> nslookup
www.yohoo.com


Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

Non-authoritative answer:

Name:    yohoo.com

Address:  216.116.98.143

Aliases:  www.yohoo.com

tung@traveler:~> nslookup

Default Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

> www.yohoo.com

Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

Non-authoritative answer:

Name:    yohoo.com

Address:  216.116.98.143

Aliases:  www.yohoo.com

 

Authoritative/Non-Authoritative

在查詢時有時會出現 Non-authoritative answer, 代表這個答案是由 local
DNS 的 cache 中直接讀出來的, 而不是 local DNS 向真正負責這個 domain 的
name server 問來的.

 

常用的一些 option/command

1. set all

可以得知目前 nslookup 的一些 default 設定值

tung@traveler:~>
nslookup


Default Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

> set all

Default Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

Set options:

  nodebug        
defname         search         
recurse


  nod2           
novc           
noignoretc      port=53


  querytype=A     class=IN       
timeout=5       retry=4


  root=a.root-servers.net.

  domain=ee.ncku.edu.tw

  srchlist=ee.ncku.edu.tw

2. server dns_server_ip

表示將內定的 local DNS 換成另一部 server

Ex: server 140.116.2.6

3. set type=any

表示在查詢某個 domain name 時, 將和這個 domain name 的一些相關資料一併顯示出來

> set type=any

> www.yohoo.com

Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

Non-authoritative answer:

www.yohoo.com   canonical name = yohoo.com

Authoritative answers can be found from:

yohoo.com      
nameserver = ns1.netgateway.net


yohoo.com      
nameserver = ns2.netgateway.net


ns1.netgateway.net     
internet address = 216.116.98.7


ns2.netgateway.net     
internet address = 216.116.98.8

在上面的這個例子, 我們除了知道 www.yohoo.com 的 IP 外, 我們還得知了
yohoo.com 是由哪部 name server 在負責的. 因此如果想要知道 www.yohoo.com
真正在 yohoo.com 上的記錄是如何, 而不要有 local DNS cache 中傳回的資料,
我們可以配合使用 server 這個 command 將 default local DNS 改為負責 yohoo.com
的 DNS, 然後再查詢一次

> server 216.116.98.7

Default Server:  ns1.netgateway.net

Address:  216.116.98.7

> www.yohoo.com

Server:  ns1.netgateway.net

Address:  216.116.98.7

Name:    yohoo.com

Address:  216.116.98.143

Aliases:  www.yohoo.com

4. set type=ptr

本來要由 IP 反查 domain name時, 在直接打 IP 就行了, 但如果已經下了
type=any 的話, 要由 IP 反查時就沒那麼方便了, 此時 IP 4 個數字要倒著寫,
最後還要加上 in-addr.arpa. 以查 140.116.72.219 為例, 要輸入的就是 219.72.116.140.in-addr.arpa

tung@traveler:~> nslookup

Default Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

> 140.116.72.219

Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

Name:    garfield.ee.ncku.edu.tw

Address:  140.116.72.219

> set type=any

> 140.116.72.219

Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

*** sun4.ee.ncku.edu.tw can't find 140.116.72.219:
Non-existent host/domain


> 219.72.116.140.in-addr.arpa

Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

219.72.116.140.in-addr.arpa    
name = garfield.ee.ncku.edu.tw


72.116.140.IN-ADDR.ARPA nameserver = sun4.ee.ncku.edu.tw

sun4.ee.ncku.edu.tw     internet
address = 140.116.72.14

另外一個辦法就是先下 set type=ptr 或 set type=a 命令, 脫離 type=any
模式, 再進行 IP 反查 domain name 的 command

> set typr=ptr

> 140.116.72.219

Server:  sun4.ee.ncku.edu.tw

Address:  140.116.72.14

219.72.116.140.in-addr.arpa    
name = garfield.ee.ncku.edu.tw


72.116.140.IN-ADDR.ARPA nameserver = sun4.ee.ncku.edu.tw

sun4.ee.ncku.edu.tw     internet
address = 140.116.72.14

5. ls domain

這個命令是要求 name server 將其負責的 zone 內容
show 出來, 這個動作相當於 name server 的整份記錄從 server 端傳回給 nslookup
這個程式, 這種傳回整個 zone 的動作叫作 zone transfer


> set type=any

> ee.ncku.edu.tw

Server:  cs.ncku.edu.tw

Address:  140.116.2.6

ee.ncku.edu.tw  nameserver = sun4.ee.ncku.edu.tw

ee.ncku.edu.tw  preference = 1, mail exchanger
= eembox.ee.ncku.edu.tw


ee.ncku.edu.tw  internet address = 140.116.72.15

ee.ncku.edu.tw

        origin
= sun4.ee.ncku.edu.tw


        mail
addr = root.sun4.ee.ncku.edu.tw


        serial
= 1999033001


        refresh
= 3600 (1H)


        retry  
= 900 (15M)


        expire 
= 3600000 (5w6d16h)


        minimum
ttl = 3600 (1H)


ee.ncku.edu.tw  nameserver = sun4.ee.ncku.edu.tw

sun4.ee.ncku.edu.tw     internet
address = 140.116.72.14


eembox.ee.ncku.edu.tw   internet address
= 140.116.72.15


> ls ee.ncku.edu.tw

Default Server:  cs.ncku.edu.tw

Address:  140.116.2.6
> [sun4.ee.ncku.edu.tw]

$ORIGIN ee.ncku.edu.tw.

@                      
1H IN A         140.116.72.15


hdlib4                 
1H IN A         140.116.72.4


ds114                  
1H IN A         140.116.72.114


hdlib5                 
1H IN A         140.116.72.5


ds115                  
1H IN A         140.116.72.115


yokoyama1              
1H IN A         140.116.227.217


hdlib6                 
1H IN A         140.116.72.6


ds116                  
1H IN A         140.116.72.116


yokoyama2              
1H IN A         140.116.227.218


ds117                  
1H IN A         140.116.72.117


ds120                  
1H IN A         140.116.72.120


ds118                  
1H IN A         140.116.72.118


ds121                  
1H IN A         140.116.72.121


ds119                  
1H IN A         140.116.72.119


ds122                  
1H IN A         140.116.72.122


ds123                  
1H IN A         140.116.72.123


intelab01              
1H IN A         140.116.227.39


.....

The nslookup Manual Page

   原来nslookup的功能非常强大,我以前以为之可以nslookup host/ip 进行域名的正向/反向查询,下面是以外国人写的nslookup在unix中的manual page
=========================================================================================
This page contains the manual page for the UNIX shell comand "nslookup"
for your reference. Note that this is taken straight from the man page
on my system, your system might be running a different version or not
have this command enabled at all.




NSLOOKUP(8)                                           NSLOOKUP(8)

NAME
nslookup - query Internet name servers interactively

SYNOPSIS
nslookup [ -option ... ] [ host-to-find | - [ server ]]

DESCRIPTION
Nslookup is a program to query Internet domain name
servers. Nslookup has two modes: interactive and non-
interactive. Interactive mode allows the user to query
name servers for information about various hosts and
domains or to print a list of hosts in a domain. Non-
interactive mode is used to print just the name and
requested information for a host or domain.

ARGUMENTS
Interactive mode is entered in the following cases:

a) when no arguments are given (the default name server
will be used),

b) when the first argument is a hyphen (-) and the second
argument is the host name or Internet address of a
name server.

Non-interactive mode is used when the name or Internet
address of the host to be looked up is given as the first
argument. The optional second argument specifies the host
name or address of a name server.

The options listed under the ``set'' command below can be
specified in the .nslookuprc file in the user's home
directory if they are listed one per line. Options can
also be specified on the command line if they precede the
arguments and are prefixed with a hyphen. For example, to
change the default query type to host information, and the
initial timeout to 10 seconds, type:
nslookup -query=hinfo -timeout=10

INTERACTIVE COMMANDS
Commands may be interrupted at any time by typing a con-
trol-C. To exit, type a control-D (EOF) or type exit.
The command line length must be less than 256 characters.
To treat a built-in command as a host name, precede it
with an escape character (). N.B. an unrecognized com-
mand will be interpreted as a host name.

host [server]
Look up information for host using the current
default server or using server if specified. If
host is an Internet address and the query type is A
or PTR, the name of the host is returned. If host
is a name and does not have a trailing period, the
default domain name is appended to the name. (This
behavior depends on the state of the set options
domain, srchlist, defname, and search). To look up
a host not in the current domain, append a period
to the name.

server domain
lserver domain
Change the default server to domain. Lserver uses
the initial server to look up information about
domain while server uses the current default
server. If an authoritative answer can't be found,
the names of servers that might have the answer are
returned.

root Changes the default server to the server for the
root of the domain name space. Currently, the host
ns.internic.net is used. (This command is a syn-
onym for lserver ns.internic.net.) The name of the
root server can be changed with the set root com-
mand.

finger [name] [> filename]
finger [name] [>> filename]
Connects with the finger server on the current
host. The current host is defined when a previous
lookup for a host was successful and returned
address information (see the set querytype=A com-
mand). Name is optional. > and >> can be used to
redirect output in the usual manner.

ls [option] domain [> filename]
ls [option] domain [>> filename]
List the information available for domain, option-
ally creating or appending to filename. The
default output contains host names and their Inter-
net addresses. Option can be one of the following:

-t querytype
lists all records of the specified type (see
querytype below).

-a lists aliases of hosts in the domain. synonym
for -t CNAME.

-d lists all records for the domain. synonym for
-t ANY.

-h lists CPU and operating system information for
the domain. synonym for -t HINFO.

-s lists well-known services of hosts in the
domain. synonym for -t WKS.

When output is directed to a file, hash marks are
printed for every 50 records received from the
server.

view filename
Sorts and lists the output of previous ls com-
mand(s) with more(1).

help

? Prints a brief summary of commands.

exit Exits the program.

set keyword[=value]
This command is used to change state information
that affects the lookups. Valid keywords are:

all Prints the current values of the frequently-
used options to set. Information about the
current default server and host is also
printed.

class=value
Change the query class to one of:

IN the Internet class.

CHAOS the Chaos class.

HESIOD the MIT Athena Hesiod class.

ANY wildcard (any of the above).

The class specifies the protocol group of
the information.
(Default = IN, abbreviation = cl)

[no]debug
Turn debugging mode on. A lot more informa-
tion is printed about the packet sent to the
server and the resulting answer.
(Default = nodebug, abbreviation = [no]deb)

[no]d2 Turn exhaustive debugging mode on. Essen-
tially all fields of every packet are
printed.
(Default = nod2)

domain=name
Change the default domain name to name. The
default domain name is appended to a lookup
request depending on the state of the def-
name and search options. The domain search
list contains the parents of the default
domain if it has at least two components in
its name. For example, if the default
domain is CC.Berkeley.EDU, the search list
is CC.Berkeley.EDU and Berkeley.EDU. Use
the set srchlist command to specify a dif-
ferent list. Use the set all command to
display the list.
(Default = value from hostname,
/etc/resolv.conf or LOCALDOMAIN, abbrevia-
tion = do)

srchlist=name1/name2/...
Change the default domain name to name1 and
the domain search list to name1, name2, etc.
A maximum of 6 names separated by slashes
(/) can be specified. For example,
set srch-
list=lcs.MIT.EDU/ai.MIT.EDU/MIT.EDU
sets the domain to lcs.MIT.EDU and the
search list to the three names. This com-
mand overrides the default domain name and
search list of the set domain command. Use
the set all command to display the list.
(Default = value based on hostname,
/etc/resolv.conf or LOCALDOMAIN, abbrevia-
tion = srchl)

[no]defname
If set, append the default domain name to a
single-component lookup request (i.e., one
that does not contain a period).
(Default = defname, abbreviation = [no]def)

[no]search
If the lookup request contains at least one
period but doesn't end with a trailing
period, append the domain names in the
domain search list to the request until an
answer is received.
(Default = search, abbreviation = [no]sea)

port=value
Change the default TCP/UDP name server port
to value.
(Default = 53, abbreviation = po)

querytype=value
type=value
Change the type of information query to one
of:

A the host's Internet address.

CNAME the canonical name for an alias.

HINFO the host CPU and operating system
type.

MINFO the mailbox or mail list informa-
tion.

MX the mail exchanger.

NS the name server for the named
zone.

PTR the host name if the query is an
Internet address, otherwise the
pointer to other information.

SOA the domain's ``start-of-author-
ity'' information.

TXT the text information.

UINFO the user information.

WKS the supported well-known services.

Other types (ANY, AXFR, MB, MD, MF, NULL)
are described in the RFC-1035 document.
(Default = A, abbreviations = q, ty)

[no]recurse
Tell the name server to query other servers
if it does not have the information.
(Default = recurse, abbreviation = [no]rec)

retry=number
Set the number of retries to number. When a
reply to a request is not received within a
certain amount of time (changed with set
timeout), the timeout period is doubled and
the request is resent. The retry value con-
trols how many times a request is resent
before giving up.
(Default = 4, abbreviation = ret)

root=host
Change the name of the root server to host.
This affects the root command.
(Default = ns.internic.net., abbreviation =
ro)

timeout=number
Change the initial timeout interval for
waiting for a reply to number seconds. Each
retry doubles the timeout period.
(Default = 5 seconds, abbreviation = ti)

[no]vc Always use a virtual circuit when sending
requests to the server.
(Default = novc, abbreviation = [no]v)

[no]ignoretc
Ignore packet truncation errors.
(Default = noignoretc, abbreviation =
[no]ig)

DIAGNOSTICS
If the lookup request was not successful, an error message
is printed. Possible errors are:

Timed out
The server did not respond to a request after a cer-
tain amount of time (changed with set timeout=value)
and a certain number of retries (changed with set
retry=value).

No response from server
No name server is running on the server machine.

No records
The server does not have resource records of the cur-
rent query type for the host, although the host name
is valid. The query type is specified with the set
querytype command.

Non-existent domain
The host or domain name does not exist.

Connection refused
Network is unreachable
The connection to the name or finger server could not
be made at the current time. This error commonly
occurs with ls and finger requests.

Server failure
The name server found an internal inconsistency in
its database and could not return a valid answer.

Refused
The name server refused to service the request.

Format error
The name server found that the request packet was not
in the proper format. It may indicate an error in
nslookup.

FILES
/etc/resolv.conf initial domain name and
name server addresses.
$HOME/.nslookuprc user's initial options.
/usr/share/misc/nslookup.help summary of commands.

ENVIRONMENT
HOSTALIASES file containing host aliases.
LOCALDOMAIN overrides default domain.

SEE ALSO
resolver(3), resolver(5), named(8),
RFC-1034 ``Domain Names - Concepts and Facilities''
RFC-1035 ``Domain Names - Implementation and Specifica-
tion''

AUTHOR
Andrew Cherenson


May 27, 2007

删除XP系统保护文件

        SFC是由winlogon执行的,保护的文件列表在sfc_files.dll里。为了保护文件,winlogon必须打开文件所在的目录,监控目录下
的文件变化。如果被保护的文件被修改时会跳出来做校验。所以即使被保护的文件不存在,winlogin也要创建一个空目录监控着,一但文件被安装时立马生
效,并且拷贝一个副本到dllcache中。

删除Windows XP系统文件


        在默认状态下,Windows
XP的文件保护功能禁止用户删除系统文件,如果用户出于某种需要必须删除系统文件的话,可以通过修改注册表来解除这个限制。打开注册表编辑器,依次展开
HKEY_LOCAL_MACHINE SOFTWAREMicrosoftWindows NT
CurrentVersionWinlogon分支,双击DWORD值“SFCDisable”,在打开窗口中将它的值改为“FFFFFF9D”(十六进
制)。重新启动计算机后,就可以删除系统文件了。



小提示:删除系统文件之后如果想重新启用文件保护功能,只需将该DWORD值改为“0”即可。另外,删除文件之前应进行必要的备份。

基于终端的常用工具

from: http://linuxtoy.org/archives/terminal-based-tools.html


就算 Linux 没有 GUI(图形用户界面),我们在 CLI(命令行界面)中依然能够应付自如。从浏览网络到联络朋友,从获取资源到音影娱乐,从编辑文本到观看图片……在 GUI 中能做的,CLI 也同样可以办到。我想这即是 Linux 的魅力了。

  • 网络浏览:推荐使用 Elinks,Elinks 对于框架、表格以及鼠标的支持都很不错。当然,你也可以将 LynxLinksw3m 作为备选。
  • 邮件收发:Mutt + Fetchmail + msmtp 是很好的组合。其中,Mutt 用于邮件的管理,Fetchmail 用来收取邮件,而 msmtp 则用来发送邮件。
  • 联络聊天:CenterICQ 支持 MSN、Jabber、IRC、Yahoo!、AIM、ICQ 等多种即时通讯协议。它同时也具有一个 UTF-8 版本。其他的工具包括 Freetalk(Gtalk 用户适用)、Naim(支持 AIM、ICQ、IRC 等)、Irssi(IRC 用户适用) 等。
  • 新闻阅读:现在通过 RSS 及时获取信息是一种比较流行的方式。你可以使用 Raggle 来满足每天阅读新闻的需求。Raggle 使用 Ruby 所写,它支持各种版本的 RSS、能够导入/导出 OPML、可定制绑定的快捷键。
  • 文件管理:Midnight Commander(简称 mc)是一个值得使用的文件管理工具。
  • 查看图片:你可以试试 zgv,我也在使用 feh
  • 听歌观影:如果你需要听歌,MOC 绝对值得一用。另外,你也可以试试 cplay。看电影的话,当然是 MPlayer 了。
  • 文本编辑:既然已经有了 VIMEmacs,那么我们还奢求什么呢?
  • 下载上传:主力下载工具使用 wget,要加速可以使用 axel。至于上传 ftp,lftp、nftp 都是不错的选择。此外,对付 BitTorrent 的话,则可以使用 rTorrent
  • 窗口管理:Twin,我没有用过,不晓得怎样,有兴趣者可自行从其主页了解详情。我现在使用 Screen,并已经习惯了开机便进入 Screen 的生活。

[参考]

- A day without X

- More terminal programs you should be using … like a pro

毕业设计

此文件由word 2007 的预发布版本创建 http://support.microsoft.com/kb/926309/zh-cn

Ecma Office Open XML File Formats Standard -
Final draft - 9th of October 2006
http://www.ecma-international.org/news/TC45_current_work/TC45-2006-50_final_draft.htm
可能做完论文后再也不会去看它了,但现在要用常看,先扔着


Installing DB2 9.1 on Ubuntu Dapper (6.06) ZZ

 原文:http://project-tigershark.com/people/rob/blog/2007/01/02/installing-db2-91-on-ubuntu-dapper-606/

DB2 is one of the few industrial strength, fully featured database
systems that has a community edition available for free use. It
supports stored-procedures, and all the standard MySQL-esque features,
in addition to triggers and all sorts of data partitioning. And it even
ships with a full set of administrative GUI tools. Unfortunately,
nobody has taken the time to document the process of getting DB2
installed on Ubuntu Dapper (6.06 LTS). This is my attempt to do so and
save others some of the confusion that I went though getting it to work.

If you’re feeling adventurous, you can read the official DB2 9.1 documentation and the many, many DB2 Manuals available on IBMs site.


Getting DB2

There are a number of verions of DB2 available from IBM. Unless you
have usage requirements that demand advanced data replication,
partitioning, and clusteriing, the freely distributed Express-C
community version of DB2 should suffice. The only notable limitation
imposed by this version is a 2CPU/4GB Ram hardware constraint on the
physical host on which the software is installed. More information on
the varying DB2 versions, their features, and their constraints can be
found on the official IBM DB2 page. You can get DB2 Express-C at the IBM downloads page.

Installing DB2

The DB2 installation package is rpm-based, so we’ll need to install an
rpm-compatible installer for Ubuntu. For this, we apt-get alien, an rpm
package installer:

$ sudo apt-get install alien


Now we may db2_install installation script that is bundled with DB2. This needs to be done as root:


$ tar xzvf db2exc_91_LNX_x86.tar.gz

$ sudo exp/disk1/db2_install



This should take a few minutes to install. At the time of this
writing, the installation procedure had approximately ten steps and
lasted about three to five minutes. Note that depending on the version
of gcc that you have installed (if at all), you may need to install libstdc++5, as it is required for successful installation. This is easily obtained:

$ sudo apt-get install libstdc++5


Setting Up Groups/Users

Now that we have DB2 installed, we need to configure it for use. We
start by creating the standard DB2 user groups: instance owners, fenced
users, and administrators. (Note that these commands need to be run as
root — the sudo is dropped here for notational simplicity and a # is added in its place for clarity).

# groupadd -g 999 db2iadm1

# groupadd -g 998 db2fadm1

# groupadd -g 997 dasadm1


Now we’ll create a default user for each group:

# useradd -u 1002 -g dasadm1 -m -d /home/dasusr1 dasusr1 -p password2

# useradd -u 1003 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1 -p password3

# useradd -u 1004 -g db2iadm1 -m -d /home/db2inst1 db2inst1 -p password4


Creating the Adminstrative Database

Now we need to create a DB2 Administration Server to administer all instances of DB2 under the purview of this installation:

# /opt/ibm/db2/V9.1/instance/dascrt -u dasusr1


Note here that dasusr1 may be any user that is a member of the dasadm1 group we set up earlier.

DB2 Instance Semantics. Creating an Instance.

A DB2 instance is an environment that acts as a logical container for a
collection of databases. It’s an abstraction that allows the creation
and usage of multiple independent DB2 environments using the same
physical resources.

We need an instance to hold all of our databases. We’l create a default instance using the db2inst1 user we just created as its owner:

# /opt/ibm/db2/V9.1/instance/db2icrt -u db2fenc1 db2inst1


As we noted, db2inst1 is the instance owner, while db2fenc1 credentials are used to execute fenced stored procedures and executables.

Starting and Stopping an Instance

A DB2 instance is an environment that acts as a logical container for a
collection of In order to start and stop the DB2 instance (remember, we
may have multiple instances for a given installation on a physical
host), we log in as the owner and call db2start after inializing the
DB2 environment:

$ su db2inst1

$. ~/sqllib/db2profile

$db2start


Stopping the environment is just as simple: we’d call db2stop instead of db2start.

You may enable (or disable) automatic DB2 instance start/stop on system start-up/shut-down by calling:

$ db2iauto -on db2inst1


where db2inst1 is the login name of the instance. Replacing the -on flag with -off disables this feature.

The Sample Database

If you wish to build the sample database bundled with DB2 in
order to play around, call db2sampl while logged into a DB2 instance
owner account:

$ su db2inst1

$ . ~/sqllib/db2profile

$ db2sampl


That’s It.

This concludes the bare-minimum needed to set up a working
DB2 environment on Ubuntu. Note that this configuration does not allow
for external connections over TCP/IP. We’d need to start a separate
service


References

[1] Official DB2 9.1 documentation

[2] DB2 Manuals

May 26, 2007

获取Linux版本信息

  //很多时候这是很必要的


1) lsb_release -a ,即可列出所有版本信息,适用于所有的linux,例如:
ox0spy@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 6.06.1 LTS
Release: 6.06
Codename: dapper
ox0spy@ubuntu:~$

2) cat /etc/redhat-release ,

这种方式下可以直接看到具体的版本号,比如 AS4 Update 1

3)rpm -q redhat-release ,

 这种方式下可看到一个所谓的release号,比如上边的例子是2.4

 这个release号和实际的版本之间存在一定的对应关系,如下:

  redhat-release-3AS-1 -> Redhat Enterprise Linux AS 3

  redhat-release-3AS-7.4 -> Redhat Enterprise Linux AS 3 Update 4

  redhat-release-4AS-2 -> Redhat Enterprise Linux AS 4

  redhat-release-4AS-2.4 -> Redhat Enterprise Linux AS 4 Update 1

  redhat-release-4AS-3 -> Redhat Enterprise Linux AS 4 Update 2

  redhat-release-4AS-4.1 -> Redhat Enterprise Linux AS 4 Update 3

  redhat-release-4AS-5.5 -> Redhat Enterprise Linux AS 4 Update 4

4) cat /etc/issue
Fedora Core release 4 (Stentz)
Kernel r on an m

5) 内核版本,cat /proc/version,例如:
ox0spy@ubuntu:~$ cat /proc/version
Linux version 2.6.15-26-server (buildd@terranova) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #1 SMP Thu Aug 3 04:09:15 UTC 2006

注意:第(2)(3)两种方法只对Redhat Linux有效

May 20, 2007

vs2005快捷键

  Shift+Alt+Enter: 切换全屏编辑
Ctrl
+B,T / Ctrl+K,K: 切换书签开关
Ctrl
+B,N / Ctrl+K,N: 移动到下一书签 
Ctrl
+B,P: 移动到上一书签 
Ctrl
+B,C: 清除全部标签
Ctrl
+I: 渐进式搜索 
Ctrl
+Shift+I: 反向渐进式搜索 
Ctrl
+F: 查找 
Ctrl
+Shift+F: 在文件中查找 
F3: 查找下一个 
Shift
+F3: 查找上一个 
Ctrl
+H: 替换 
Ctrl
+Shift+H: 在文件中替换 
Alt
+F12: 查找符号(列出所有查找结果)
Ctrl
+Shift+V: 剪贴板循环
Ctrl
+左右箭头键: 一次可以移动一个单词 
Ctrl
+上下箭头键: 滚动代码屏幕,但不移动光标位置。
Ctrl
+Shift+L: 删除当前行
Ctrl
+M,M: 隐藏或展开当前嵌套的折叠状态
Ctrl
+M,L: 将所有过程设置为相同的隐藏或展开状态
Ctrl
+M,P: 停止大纲显示 
Ctrl
+E,S: 查看空白 
Ctrl
+E,W: 自动换行 
Ctrl
+G: 转到指定行
Shift
+Alt+箭头键: 选择矩形文本 
Alt
+鼠标左按钮: 选择矩形文本
Ctrl
+Shift+U: 全部变为大写 
Ctrl
+U: 全部变为小写

代码快捷键

Ctrl
+/ Ctrl+K,L: 列出成员 
Ctrl
+Shift+空格键 / Ctrl+K,P: 参数信息
Ctrl
+K,I: 快速信息 
Ctrl
+E,C / Ctrl+K,C: 注释选定内容
Ctrl
+E,U / Ctrl+K,U: 取消选定注释内容
Ctrl
+K,M: 生成方法存根
Ctrl
+K,X: 插入代码段 
Ctrl
+K,S: 插入外侧代码 
F12: 转到所调用过程或变量的定义

窗口快捷键

Ctrl
+W,W: 浏览器窗口
Ctrl
+W,S: 解决方案管理器
Ctrl
+W,C: 类视图
Ctrl
+W,E: 错误列表
Ctrl
+W,O: 输出视图
trl
+W,P: 属性窗口
Ctrl
+W,T: 任务列表 
Ctrl
+W,X: 工具箱
Ctrl
+W,B: 书签窗口
Ctrl
+W,U: 文档大纲
Ctrl
+D,B: 断点窗口
Ctrl
+D,I: 即时窗口
Ctrl
+Tab: 活动窗体切换
Ctrl
+Shift+N: 新建项目
Ctrl
+Shift+O: 打开项目
Ctrl
+Shift+S: 全部保存
Shift
+Alt+C: 新建类
Ctrl
+Shift+A: 新建项
Shift
+Alt+Enter: 切换全屏编辑
Ctrl
+B,T / Ctrl+K,K: 切换书签开关
Ctrl
+B,N / Ctrl+K,N: 移动到下一书签 
Ctrl
+B,P: 移动到上一书签
Ctrl
+B,C: 清除全部标签
Ctrl
+I: 渐进式搜索 
Ctrl
+Shift+I: 反向渐进式搜索
Ctrl
+F: 查找 
Ctrl
+Shift+F: 在文件中查找 
F3: 查找下一个 
Shift
+F3: 查找上一个
Ctrl
+H: 替换
Ctrl
+Shift+H: 在文件中替换
Alt
+F12: 查找符号(列出所有查找结果)
Ctrl
+Shift+V: 剪贴板循环
Ctrl
+左右箭头键: 一次可以移动一个单词
Ctrl
+上下箭头键: 滚动代码屏幕,但不移动光标位置。
Ctrl
+Shift+L: 删除当前行
Ctrl
+M,M: 隐藏或展开当前嵌套的折叠状态
Ctrl
+M,L: 将所有过程设置为相同的隐藏或展开状态 
Ctrl
+M,P: 停止大纲显示
Ctrl
+E,S: 查看空白
Ctrl
+E,W: 自动换行
Ctrl
+G: 转到指定行 
Shift
+Alt+箭头键: 选择矩形文本
Alt
+鼠标左按钮: 选择矩形文本
Ctrl
+Shift+U: 全部变为大写 
Ctrl
+U: 全部变为小写