Archive for July, 2007

Web host forum - The nsswitch.conf File Version 2 of the GNU

Friday, July 20th, 2007

The nsswitch.conf File Version 2 of the GNU standard library includes a more powerful and flexible replacement for the older host.conf mechanism. The concept of the name service has been extended to include a variety of different types of information. Configuration options for all of the different functions that query these databases have been brought back into a single configuration file; the nsswitch.conf file. The nsswitch.conf file allows the system administrator to configure a wide variety of different databases. We’ll limit our discussion to options that relate to host and network IP address resolution. You can easily find more information about the other features by reading the GNU standard library documentation. Options in nsswitch.conf must appear on separate lines. Fields may be separated by whitespace (spaces or tabs). A hash sign (#) introduces a comment that extends to the next newline. Each line describes a particular service; hostname resolution is one of these. The first field in each line is the name of the database, ending with a colon. The database name associated with host address resolution is hosts. A related database is networks, which is used for resolution of network names into network addresses. The remainder of each line stores options that determine the way lookups for that database are performed. The following options are available: dns Use the Domain Name System (DNS) service to resolve the address. This makes sense only for host address resolution, not network address resolution. This mechanism uses the /etc/resolv.conf file that we’ll describe later in the chapter. files Search a local file for the host or network name and its corresponding address. This option uses the traditional /etc/hosts and /etc/network files. nis or nisplus Use the Network Information System (NIS) to resolve the host or network address. NIS and NIS+ are discussed in detail in Chapter 13, The Network Information System. The order in which the services to be queried are listed determines the order in which they are queried when attempting to resolve a name. The query-order list is in the service description in the /etc/nsswitch.conf file. The services are queried from left to right and by default searching stops when a resolution is successful. A simple example of host and network database specification that would mimic our configuration using the older libc standard library is shown in Example 6.2. Example 6.2: Sample nsswitch.conf File # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # Information about this file is available in the `libc6-doc’ package. hosts: dns files networks: files This example causes the system to look up hosts first in the Domain Name System, and the /etc/hosts file, if that can’t find them. Network name lookups would be attempted using only the /etc/networks file. You are able to control the lookup behavior more precisely using “action items” that describe what action to take given the result of the previous lookup attempt. Action items appear between service specifications, and are enclosed within square brackets, [ ]. The general syntax of the action statement is: [ [!] status = action … ] There are two possible actions: return Controls returns to the program that attempted the name resolution. If a lookup attempt was successful, the resolver will return with the details, otherwise it will return a zero result.

nospoof As we’ll explain (Web server application) in the section “Reverse

Thursday, July 19th, 2007

nospoof As we’ll explain in the section “Reverse Lookups”, DNS allows you to find the hostname belonging to an IP address by using the in-addr.arpa domain. Attempts by name servers to supply a false hostname are called spoofing. To guard against this, the resolver can be configured to check whether the original IP address is in fact associated with the obtained hostname. If not, the name is rejected and an error is returned. This behavior is turned on by setting nospoof on. alert This option takes on or off as arguments. If it is turned on, any spoof attempts will cause the resolver to log a message to the syslog facility. trim This option takes an argument specifying a domain name that will be removed from hostnames before lookup. This is useful for hosts entries, for which you might only want to specify hostnames without a local domain. If you specify your local domain name here, it will be removed from a lookup of a host with the local domain name appended, thus allowing the lookup in /etc/hosts to succeed. The domain name you add must end with the (.) character (e.g., :linux.org.au.) if trim is to work correctly. trim options accumulate; you can consider your host as being local to several domains. A sample file for vlager is shown in Example 6.1. Example 6.1: Sample host.conf File # /etc/host.conf # We have named running, but no NIS (yet) order bind,hosts # Allow multiple addrs multi on # Guard against spoof attempts nospoof on # Trim local domain (not really necessary). trim vbrew.com. Resolver environment variables The settings from host.conf may be overridden using a number of environment variables: RESOLV_HOST_CONF This variable specifies a file to be read instead of /etc/host.conf. RESOLV_SERV_ORDER This variable overrides the order option given in host.conf. Services are given as hosts, bind, and nis, separated by a space, comma, colon, or semicolon. RESOLV_SPOOF_CHECK This variable determines the measures taken against spoofing. It is completely disabled by off. The values warn and warn off enable spoof checking by turning logging on and off, respectively. A value of * turns on spoof checks, but leaves the logging facility as defined in host.conf. RESOLV_MULTI This variable uses a value of on or off to override the multi options from host.conf. RESOLV_OVERRIDE_TRIM_DOMAINS This variable specifies a list of trim domains that override those given in host.conf. Trim domains were explained earlier when we discussed the trim keyword. RESOLV_ADD_TRIM_DOMAINS This variable specifies a list of trim domains that are added to those given in host.conf.

Chapter 6 - Name Service and Resolver Configuration (Yahoo web hosting)

Thursday, July 19th, 2007

Chapter 6 - Name Service and Resolver Configuration As we discussed in Chapter 2, Issues of TCP/IP Networking, TCP/IP networking may rely on different schemes to convert names into addresses. The simplest way is a host table stored in /etc/hosts. This is useful only for small LANs that are run by one single administrator and otherwise have no IP traffic with the outside world. The format of the hosts file has already been described in Chapter 5, Configuring TCP/IP Networking. Alternatively, you can use the Berkeley Internet Name Domain service (BIND) for resolving hostnames to IP addresses. Configuring BIND can be a real chore, but once you’ve done it, you can easily make changes in the network topology. On Linux, as on many other Unixish systems, name service is provided through a program called named. At startup, it loads a set of master files into its internal cache and waits for queries from remote or local user processes. There are different ways to set up BIND, and not all require you to run a name server on every host. This chapter can do little more than give a rough sketch of how DNS works and how to operate a name server. It should be sufficient if you have a small LAN and an Internet uplink. For the most current information, you may want to check the documentation contained in the BIND source package, which supplies manual pages, release notes, and the BIND Operator’s Guide (BOG). Don’t let this name scare you off; it’s actually a very useful document. For a more comprehensive coverage of DNS and associated issues, you may find DNS and BIND by Paul Albitz and Cricket Liu (O’Reilly) a useful reference. DNS questions may be answered in a newsgroup called comp.protocols.tcp-ip.domains. For technical details, the Domain Name System is defined by RFC numbers 1033, 1034, and 1035. The Resolver Library The term resolver refers not to a special application, but to the resolver library. This is a collection of functions that can be found in the standard C library. The central routines are gethostbyname(2) and gethostbyaddr(2), which look up all IP addresses associated with a host name, and vice versa. They may be configured to simply look up the information in hosts, to query a number of DNS name servers, or to use the hosts database of Network Information Service (NIS). The resolver functions read configuration files when they are invoked. From these configuration files, they determine what databases to query, in which order, and other details relevant to how you’ve configured your environment. The older Linux standard library, libc, used /etc/host.conf as its master configuration file, but Version 2 of the GNU standard library, glibc, uses /etc/nsswitch.conf. We’ll describe each in turn, since both are commonly used. The host.conf File The /etc/host.conf tells the older Linux standard library resolver functions which services to use, and in what order. Options in host.conf must appear on separate lines. Fields may be separated by white space (spaces or tabs). A hash sign (#) introduces a comment that extends to the next newline. The following options are available: order This option determines the order in which the resolving services are tried. Valid options are bind for querying the name server, hosts for lookups in /etc/hosts, and nis for NIS lookups. Any or all of them may be specified. The order in which they appear on the line determines the order in which the respective services are tried. multi multi takes on or off as options. This determines if a host in /etc/hosts is allowed to have several IP addresses, which is usually referred to as being “multi-homed.” The default is off. This flag has no effect on DNS or NIS queries.

Best web site - E Escape sequence () (Definition) Using the

Sunday, July 15th, 2007

JavaScript Programmer’s Reference Error.toString() (Method) Returns a string

Sunday, July 15th, 2007

JavaScript Programmer’s Reference Error.toString() (Method) Returns a string primitive version of an Error object. Availability: ECMAScript edition 3 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: String primitive JavaScript syntax: -myBoolean.toString() The value of the object is converted to a string value that represents its value. The value returned is implementation dependent. See also: Cast operator, Error.prototype, toString() Cross-references: ECMA 262 edition 3 section 15.11.4.4 Escape sequence () (Definition) A means of defining characters that cannot easily be typed on a keyboard. Availability: ECMAScript edition 2 Opera 3.0 The string delimiter characters present problems if you need to include them inside a string. Typically you may want to include a single quote as an apostrophe, as in the contraction of do not to don’t. Or you may want to enclose a spoken comment inside double quotation marks. Because the single and double quotes are generally interchangeable in JavaScript, in most cases the problem is easy to solve. To use ” inside a string, you can do it like this: myString = ‘A man said “hello” to me’; Using a double quote to include single quotes in your string, you might do this: myString = “Don’t do that”;

E Error.prototype (Property) . Error.message (according to (Web site layout)

Sunday, July 15th, 2007

E Error.prototype (Property) . Error.message (according to ECMA) . Error.description (according to Microsoft) The following methods are inherited from the Error.prototype: . Error.toString() The example demonstrates how to provide extensions to all instances of this class by adding a function to the prototype object to emulate the ECMA standard message property that is lacking in some implementations. Example code: See also: Error(), Error(), Error.constructor, Error.toString(), prototype property Property attributes: ReadOnly, DontDelete, DontEnum. Cross-references: ECMA 262 edition 3 section 15.11.3.1

JavaScript Programmer’s Reference Error.number (Property) A property that

Saturday, July 14th, 2007

JavaScript Programmer’s Reference Error.number (Property) A property that corresponds to the number argument in the constructor function. Availability: JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Property/method value type: Number primitive JavaScript syntax: -myError.number This is the error number your custom error will be registered under. Unless you change it by assigning a new value to this property, it will contain the value that was passed in the number argument to the constructor function. The number is a 32 bit value consisting of a facility code and an error number. The upper 16 bits is the facility code and the lower 16 bits the error number within that facility. Error.prototype (Property) The prototype for the Error object that can be used to extend the interface for all Error objects. Availability: ECMAScript edition 3 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Netscape Enterprise Server 2.0 Opera 3.0 Property/method value type: Error object -Error.prototype JavaScript syntax: -myError.constructor.prototype This is the Error prototype object belonging to the global object and from which all Error objects are descended. The initial value of Error.prototypeis the built-in Error prototype object. The value of the prototype property of an Errorobject is used to initialize child objects when that Error object is used as a constructor. The following properties are inherited from the Error.prototype: . Error.prototype . Error.constructor . Error.name

E Error.name (Property) A human readable textual (Photography web hosting)

Saturday, July 14th, 2007

E Error.name (Property) A human readable textual description of the custom error is available in this property. You can assign a new value if you wish. Reading the property yields the value that was passed in the description argument to the constructor function unless it has been changed since then. Warnings: . The ECMA standard describes this property as Error.message. Netscape 6.0 claims to be completely compliant and therefore should support this property. . MSIE supports the description property which is functionally identical. Cross-references: ECMA 262 edition 3 section 15.11.4.3 Error.name (Property) The name of an Errorobject can be accessed with this property. myError.name = aString - aString The new name value for the Error object Argument list: The initial value for this property is the string primitive “Error”. The ECMA standard suggests that this property can be assigned with a different name for each instance of the Error object. For native errors that are subclassed from this Error object, the name property will be the name of that object class and will be one of the following: . EvalError . RangeError . ReferenceError . SyntaxError . TypeError . URIError Cross-references: ECMA 262 edition 3 section 15.11.4.2 Availability: ECMAScript edition 3 JavaScript 1.5 JScript 5.5 Internet Explorer 5.5 Netscape 6.0 Property/method value type: String primitive -myError.name JavaScript syntax:

Web hosting india - JavaScript Programmer’s Reference Netscape provides constructors for many

Saturday, July 14th, 2007

JavaScript Programmer’s Reference Netscape provides constructors for many objects, virtually all of them in fact, even when it is highly inappropriate to do so. MSIE is far more selective and there are some occasions when you might wish for a constructor that MSIE does not make available. See also: Error.prototype Property attributes: DontEnum. Cross-references: ECMA 262 edition 3 section 15.11.4.1 Error.description (Property) A property that corresponds to the description argument in the constructor function. Availability: JScript 5.0 Internet Explorer 5.0 Property/method value type: String primitive JavaScript syntax: IE myError.description A human readable textual description of the custom error is available in this property. You can assign a new value if you wish. Reading the property yields the value that was passed in the description argument to the constructor function unless it has been changed since then. Warnings: . The ECMA standard describes this property as Error.message. MSIE supports it as the description property. Error.message (Property) A property that corresponds to the message argument in the constructor function. Availability: ECMAScript edition 3 JavaScript 1.5 JScript 5.5 Internet Explorer 5.5 Netscape 6.0 Property/method value type: String primitive JavaScript syntax: -myError.message

E Error() (Function) Error() (Function) An Error (Managed web hosting)

Saturday, July 14th, 2007

E Error() (Function) Error() (Function) An Error object constructor. Availability: ECMAScript edition 3 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 -Error() -Error(aNumber) JavaScript syntax: -Error(aNumber, aText) aNumber An error number Argument list: aText A text describing the error When the Error() constructor is called as a function, it creates and initializes a new Error object. The function call Error() is equivalent to the expression new Error() with the same arguments. See also: Error.prototype Cross-references: ECMA 262 edition 3 section 15.11.1 Error.constructor (Property) A reference to a constructor object. Availability: ECMAScript edition 3 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Property/method value type: Error object JavaScript syntax: -myError.constructor The initial value of Error.prototype.constructoris the built-in Error() constructor. You can use this as one way of creating Error objects, although it is more appropriate to use the new Error() technique. This property is useful if you have an object that you want to clone, but you don’t know what sort of object it is. Simply access the constructor belonging to the object you have a reference to.