Configuring NIS under Red Hat Linux

The following describes a procedure to set up NIS network name service under Red Hat Linux. This is geared toward a small installation with only one domain. However, it should be fairly evident how to add more NIS domains. The NIS domain name has nothing to do with any DNS naming convention being used.
In these examples, the following conventions are used:
NIS domain: “internal”
Code or configuration file data: colored
Root prompt on NIS master server: master#
Root prompt on NIS client host: client#

Setting up a NIS master server:

Required packages: yp-tools ypbind ypserv portmap
Set up “time” service to run via inetd/xinetd, or configure xntpd, or otherwise make sure the host’s clock is synchronized.
Edit /etc/yp.conf:

domain internal server ip.of.nis.server

Edit /etc/ypserv.conf:

dns: no
files: 30
xfr_check_port: yes
* : * : shadow.byname : port
* : * : passwd.adjunct.byname : port

Edit /etc/sysconfig/network:

NISDOMAIN="internal"

Set NIS domain name:

master# domainname internal
master# ypdomainname internal

Create file /var/yp/securenets:

host 127.0.0.1
255.255.255.0   10.0.0.0

Make sure the “portmap” service is running:

master# service portmap start
master# chkconfig portmap on

Portmap will need a rule in /etc/hosts.allow to allow access from localhost and any hosts that need to access NIS.
Start ypserv service:

master# service ypserv start

Check that it’s listening:

master# rpcinfo -u localhost ypserv

You should see:

program 100004 version 1 ready and waiting
program 100004 version 2 ready and waiting

Initialize the NIS maps:

master# /usr/lib/yp/ypinit -m

Specify local hostname, Ctrl-D, y, let finish.
Start up ypbind, yppasswdd, ypxfrd:

master# service ypbind start
master# service yppasswdd start
master# service ypxfrd start

Set YP services to run on boot-up:

master# chkconfig ypserv on
master# chkconfig ypbind on
master# chkconfig yppasswdd on
master# chkconfig ypxfrd on

NIS client host setup

Required packages: yp-tools ypbind portmap
Edit /etc/sysconfig/network:

NISDOMAIN=internal

Edit /etc/yp.conf:

domain internal server ip.of.master.server

Edit /etc/hosts:

ip.of.master.server    hostname.domain hostname

Set NIS domain-name:

client# domainname internal
client# ypdomainname internal

Edit /etc/nsswitch.conf:

passwd:     files nis
shadow:     files nis
group:      files nis

Make sure the portmap service is running:

client# service portmap start
client# chkconfig portmap on

The /etc/hosts.allow file will need rules allowing access from localhost and the NIS master server.
Start ypbind service:

client# service ypbind start
client# chkconfig ypbind on

Test it out:

client# rpcinfo -u localhost ypbind
client# ypcat passwd
Reference

Difference between IMAP and POP3

IMAP stands for “Internet Message Access Protocol”. It’s a fancy name for a protocol used by email programs like Outlook, Thunderbird, and others to access your email.
IMAP is an alternative to POP3 (Post Office Protocol 3), works in some fundamentally different ways, and makes a few fundamentally different assumptions.
IMAP and POP are two different protocols. There are many differences between these two. The main difference is that IMAP(Internet Messaged Access Protocol) always syncs with mail server so that any changes you make in your mail client (Microsoft Outlook, Thunderbird) will instantly appear on your webmail inbox.
On the other hand, in POP(Post Office Protocol), your mail client account and mail server are not synced. It means whatever changes you make to your email account in the mail client will not be transferred to the webmail inbox.
In simple terms, if you are using IMAP and mark a mail as read, it gets marked as read in your web based inbox too (because the changes are happening on the server). However, this won’t be the case if you are using POP, because the mails are downloaded to your PC and the changes won’t reflect on the server.

DNS Configuration in Linux

DNS (Domain Naming Service)
DNS is a service which is used to resolve host to IP address and zone records & configuration files.
MASTER DNS :
There are two types of zonerecords
1) Forwad lookup zone
2) Reverse lookup zone
By defaults, computer connects to another computer with the help of IP address
Forward lookup zone
——————–
It converts names into IP addresses
Reverse lookup zone
——————-
It converts IP addresses to names
Steps:

#yum install bind-* caching-nameserver*-y
#service named start
#chkconfig named on
#cd /var/named/chroot/etc
#ls
#cp named-caching-nameserver named.conf
#vi named.conf
delete ipv6 lines (line nos. 16 &22)
(line no15) Listen on port 53 {127.0.0.1; 192.168.0.254;}
(here 192.168.0.254 is server ip
(line no 21) allow-query  192.168.0.0/24 (clients range)
(line no 30) match-clients {local host; 192.168.0.0/24; } (here 192.168.0.0/24 is clients ip range & subnet mask)
(line no 31) match-destinations    {localhost; 192.168.0.0/24;}

save&quit

# vi /etc/rfc1912.zones
copy ten lines from 21 to 31 and paste under 31
change as follows
zone "redhat.com" IN {
type master;
file "redhat.for"
allow-update { none; };
};
zone "0.168.192.IN-addr-arpa IN {
type master;
file "redhat.rev"
allow-update { none; };
};

(here redhat.com is domain name and 0.168.192. is redhat.coms network range redhat.for is forward look up zone & redhat.rev is reverse lookup zone)
save & quit

# chgrp named named.conf
#chgrp named named.rfc1912.zones
#cd /var/named/chroot/var/named
#cp localhost.zone redhat.for
#cp named.local redhat.rev
# vi redhat.for

change as follows

$TTL    86400
@               IN SOA  redhat.com.       root.redhat.com. (
42              ; serial (d. adams)
3H              ; refresh
15M             ; retry
1W              ; expiry
1D )            ; minimum
IN NS           server1.redhat.com.
server1.redhat.com.             IN A            192.168.0.254
www254.redhat.com.           IN CNAME        server1.redhat.com.
station1.redhat.com.           IN A            192.168.0.1
www1.redhat.com.              IN CNAME        station1.redhat.com.
station2.redhat.com.          IN A            192.168.0.2
www2.redhat.com.             IN CNAME        station2.redhat.com.
xxx2.redhat.com.              IN CNAME        station2.redhat.com.
yyy2.redhat.com.              IN CNAME        station2.redhat.com.
station3.redhat.com.        IN A            192.168.0.3
www3.redhat.com.           IN CNAME        station3.redhat.com.
station4.redhat.com.        IN A            192.168.0.4
www4.redhat.com.           IN CNAME        station4.redhat.com.
station5.redhat.com.        IN A            192.168.0.5
www5.redhat.com.           IN CNAME        station5.redhat.com.
station6.redhat.com.            IN A            192.168.0.6
www6.redhat.com.                IN CNAME        station6.redhat.com.

(zone: zone is a storage database which contains all zone records
forward lookup zone: used for resolving hostname to ipaddress & it maintains host to ip mapping information
reverse lookup zone: used for resolving ip address to hostname & it maintains ip to hostname mapping information
types of records:
SOA : sort of authority the first record in any zone  it indicates who is authority for this domain
NS :nameserver it identifies the dns server for each zone
A record : resolves hostname to ip address
CNAME record : resolves an alias name to a hostname
PTR record : resolves an ipaddress to a hostname
MX record : resolves mail server ip (used by mail server)
TTL :time to live)
save & quit

#vi redhat.rev
(change as follows)
$TTL    86400
@       IN      SOA redhat.com.    root.redhat.com.  (
1997022700 ; Serial
28800      ; Refresh
14400      ; Retry
3600000    ; Expire
86400 )    ; Minimum
IN        NS      server1.redhat.com.
254      IN       PTR     server1.redhat.com.
1         IN       PTR     station1.redhat.com.
2        IN       PTR      station2.redhat.com.
3         IN      PTR     station3.redhat.com.
4         IN      PTR     station4.redhat.com.
5         IN      PTR     station5.redhat.com.
6         IN      PTR   station6.redhat.com.

save & quit

# chgrp named redhat.for
# chgrp named redhat.rev
# service named restart

to check:

#dig server1.redhat.com
#dig -x 192.168.0.1
(if answer is 1 server is ready if answer is 0 server has some error)

to check error in configuration file

#named-checkconf redhat.com /var/named/chroot/etc/named.conf

to check errors in zone record

#named-checkzone redhat.com /var/named/chroot/var/named/redhat.for
#named-checkzone redhat.com /var/named/chroot/var/named/redhat.rev

SLAVE DNS
Master DNS Server
It is the Master Copy of all the Zone Information.
It is Read/Write copy.
Slave DNS Server
It is Slave Backup of Master zone. It is Read Only
if any error may occur to your dns server at the time the entir network will stop.sometimes it may cause huge damage.for that one we are createing slave dns for faulttolerance and load balancing.
we need another system which contains server o/s
steps

#yum install bind-* caching-nameserver -y
#service named start
#chkconfig named on
#cd /var/named/chroot/etc/named-rfc1912.zone

(change as follows)
copy 10 lines from 21 to 31 paste under 31

zone "redhat.com"
type slave;
file "redhat.for"
masters {192.168.0.254:};
zone "0.168.192. IN-ADDR-arpa" IN {
type slave ;
file " redhat.rev"
masters {192.168.0.254;};

save& quit

#service named restart

go to client
#i /etc/resolv.conf

namesverver 192.168.0.254
nameserver 192.168.0.1 (slave dns ip)

FORWARDERS
if you have trusted relationship with another company  those comapny users can enter into our network & our company users can enter into their network by using this forwarders
steps
in master dns server

# vi /var/named/chroot/etc/named.conf

add aline

forwarders {192.168.10.254:};
forward only ;
};

(here 192.168.10.254 is trusted companies dns)
save & quit

#service named restart