Showing posts with label web server. Show all posts
Showing posts with label web server. Show all posts

Sunday, June 28, 2020

Dns Server


DNS server domain resolver of your website Name. It is a name resolution service. DNS server resolves domain address(www.example.com) into IP address which is called forward lookup in technical term and it is also used to resolve the IP address to the domain name which is called reverse lookup.
  • the lookup mechanism used to map an IP address to the domain name and vice-versa. the resolver DNS server is over the world they are in a distributed manner to reduce the load on a specific server. these servers dynamically modify and update their records as a new domain registered every second.
  • Now the question arises that we need the DNS server because domain names are easier to remember instead of IP addresses.  

Parts of DNS

  1. Namespace: Database contains all the information- delegations, zones,  domains.
  2. Servers: Makes the namespace available for clients-serves
  3. Resolver: Will query the servers about a particular namespace and find out the particular information of that namespace.


Types

1.Authoritative Servers (Responsible to give reliable answers for certain zones
     Master(Primary)
     Slave(Secondary)
2. Caching/Recursive Server

The cache text file contains names and addresses of root DNS servers that are needed to resolve names outside of the authoritative DNS domains. Root DNS Server is a group of a number of servers that are authoritative to resolve queries at the root level.

In Windows Server: /Windows/System32/Dns/cache.dns

In Centos: /etc/bind/db.root


DNS Working

when the user opens up the browser and type any website name and search for it than before opening the website DNS server comes into play because the internet works on IP address, not on a domain name, therefore, it became necessary for some to map this domain name into IP address. For this, the user query first passes to its local DNS first about the website IP address. The first process is that web browser searches for IP address inside its local cache file as I mentioned above if the cache file can't find IP address then it asks the local DNS server for IP.

Let's understand in brief

1. Client: searches securitythread.blogspot.com

2. Local DNS searches inside the DNS cache file for IP Address if found return to the browser if not then query passes to the local DNS server for further steps

3. Local DNS asks to roots server for IP but root server only contains top-level Domain like .com,.org,.net hence it only gives IP address of .com server in our case.

4. Then local DNS ask to .com server for the IP address of securitythread.blogspot.com but .com server only able to give the nearer public DNS server IP address like we use 8.8.8.8 for google.com

5. Public DNS server gives the IP address of securitythread.blogspot.com  to our local DNS server which is further passed to the browser.





DNS Structure

It is like a hierarchical structure as shown: 

key-term to understand:

HOSTNAME:  www.securitythread.blogspot.com

FULLY QUALIFIED DOMAIN NAME(FQDN):  www.securitythread.blogspot.com

FQDN= Hostname + Domain name 

www.securitythread.blogspot.com = www+securitythread.blogspot.com

Top-level Domain(TLD)

Generic top-level domain = .org, .com, .edu

Country code top-level Domain = .in, .uk, .usa

DNS structure



DNS QUERY

Query is a name resolution request from the local DNS server to point out the IP address of the given website.

Types: Iterative and Recursive

Iterative: Query which directed towards the DNS server and answered with many intermediate refereed servers.

Recursive: Query sent to a DNS server requires a complete answer there is no other DNS referral server



DNS Server types

Authoritative: Master(primary)

                        Slave(secondary)

Non-Authorative: Our own cache server

The major difference is that the primary server resolves the query with its own database. whereas non-authoritative server doesn't resolve the query with its database, actually refer the query to another DNS server for resolving.

Primary(master) DNS server

It has the main database to perform read/write operation. More than one Primary Server can also be installed for Redundancy & Fault Tolerance. 

Secondary DNS server

This only has a copy of the main primary server database. It Established to balance the load on Server. It has a record taken from the Primary/Master Server in a specified time interval. So the record can only be read.

Whenever the DNS server gives the response to a query the response may be of four type



DNS Answer Types

Negative Answer:When a website address for which the client is querying is not available (Its IP address doesn’t exist) then this response will come negative.

Authoritative Answer: - The Server has the record of that website in its own Database. Our Local DNS Server will also be called Authoritative Server if it has the website record in its own Database.

Non-Authoritative Answer:- The DNS Server doesn’t have the record of that website in its own Database but it queries other DNS Servers or check in its own DNS Cache & brings the website's record.

Referral Answer:The DNS Server doesn’t have the record of that website in its own Database but it refers to another DNS Server for that.



DNS records 

I am covering only the important ones

  1.  A: Address mapping records give IPv4 address of a website
  2. AAAAAddress mapping records give IPv6 address of a website
  3. CNAME: Canonical Name record used to resolve alias name of a website like www.securitythread.com and securitythread.com are two canonical names of each other.
  4. PTR: Reverse-lookup pointer record work just opposite to A and AAAA record. This helps to map the IP address to the website name
  5. SOAStart of Authority records gives full detail about DNS zone
  6. NS: name server records give an authoritative name server for the given host
  7. MX: mail exchanger records give mail exchange server detail.
nslookup is a command-line tool that is used for querying the domain name system to obtain domain records.

commands:

nslookup securitythread.com > gives IP address

nslookup 8.8.8.8 > hostname of this IP

nslookup type=ns securitythread.com > gets ns record 

nslookup type=all securitythread.com > gets ns record 


DNS Zone 

A DNS zone is a database that contains resource records of a neighboring DNS namespace. for example, you have a DNS zone called securitythread.com inside the DNS server. where you create records for all networking devices. 

DNS Zone Types 

  1. Primary zone: which have the read/write permission on any records
  2. Secondary zone: This zone only have the read permission on records
  3. Stub zone: store copy of a zone that contains only records used to locate name server
  4. Active Directory-integrated zone: In this data is stored in active directory zone rather than in traditional zone field

DNS zone transfer 

Zone transfer is the process of copying the content of the zonal file from a primary DNS server to a secondary DNS server so that there is synchronization of records among primary and secondary. The primary zone server notifies to a secondary server when changes occur in zone database records.

Configuring the zone transfers

  1. Active Directory-integrated zone: In this type of DNS system server running on domain controllers can store their zones on active directory domain services because of this multiple masters can be created for DNS replication, therefore, any domain controller inside the running domain can write updates to the AD integrated DNS zones for the domain name. Active Directory-integrated zones store DNS zone data in the active directory database some replication occurs through an active directory of records.               
  2. Traditional DNS zone: the transfer take place between primary and secondary zones.

Methods of Zone transfer

  1. Full transfer of records: when both primary and secondary server is configured and secondary server responses all coming request from a full copy of the primary DNS server.
  2. Incremental zone transfer: when there are any new entries and the primary and secondary server databases are not the same as primary because of new entries, therefore, to make the synchronization among the databases of both the server incremental zone transfer takes place. This requires less bandwidth than a full transfer
  3. Active directory transfer: Occur when Active directory integrated zones are replicated to the domain controller in a domain.
  4. DNS notify: DNS notify the secondary DNS server when they needed to initiate a zone transfer so that the updates of primary DNS server can be replicated to them


Friday, May 22, 2020

Type of binding in IIS(Internet Information Services) in windows server



IIS web server binding types in windows 2012R2
IIS webserver 

   



Before understanding binding, you must be able to understand the concept of these terms.

IP Address:

An IP address is a number identifying a computer or another device on the Internet. IP addresses uniquely identify the source and destination of data transmitted with the Internet Protocol.

IP address is the unique identification address of your website similar to your house address in your city with the help of the IP address of your website is uniquely identifiable among other websites on the internet.

Port Number :

A port in computer networking is an access channel for communication between two devices. When a service (server program) initially is started, it is said to bind to its designated port number. As any client program wants to use that server, it also must request to bind to the designated port number.
Port represents the numbers and basically specific to the protocol. Port numbers are from 0 to 65535. Ports 0 to 1024 are reserved for use by certain privileged services whenever there are exchanges of data or communication present, there must be a port for this.

Hostname :

A hostname is a domain name that has at least one associated IP address. For example, the domain names www.example.com and example.com are two hostnames, whereas the com domain is not, In this Second-level domain is example and hostname is www.
In simpler terms the name for your website.
All hostnames have a corresponding IP Address that is mapped to it. These hostnames are resolved to their IP Address using DNS. There are four parameters that can be used in a site binding: IP Address, Port and Host Name, and type of website but with a combination of IP address and port, you may generate a fifth possibility for binding.


iis server panel in windows server 2012R2
IIS binding panel view


Website with IP address binding :

In this we specify the IP address for each of our website, Every website has a unique IP address. For example we bind IP address 192.168.43.51 with website name www.example.com whenever an HTTP request coming to 192.168.43.51 will be served by this website irrespective to the host header


website name(hostname) with ip address
website with IP address
                       


Website with hostname binding :

In this, we have the advantage of the host header we can change the host header according to our needs. For example, we are running a small business and we afford the only cost of one IP address then we host multiple hostnames using same IP address like www.example.com and example.com host on same IP address 192.168.43.51


website binding with hostname addresss
website with hostname


Website with unique port:

In this port number of every website must be different IP address or hostname may be the same. So whenever we search for a website we specify the port also like 192.168.43.50:80 or 192.168.43.50:8010

Sometimes this type of binding causes problems also like the browser default port for HTTP is 80 so www.example.com will work fine but for example.com we must specify the port as I mentioned above.


website binding with unique port
website with unique port binding



Website with Type binding:

Type binding helps us to differentiate between HTTP and https website IIS mainly have two types through which we can identify the website whether it is bind to HTTP or https. For https type SSL certificate is required and the default port for this 443 as shown below


website binding with unique type(http/https)
website with unique type(http/https) binding




Types of web Hosting

When you think about hosting your website it is important for you to consider some factor that directly affects your website hosting. Like:- Bandwidth, storage, dependability, scalability, secure site certification, malware and spam protection, etc.


how to choose which web hosting is good for you
Types of web hosting

With all the different types of web hosting available, it can be confusing to choose the right one but after gathering all the data regarding these above factors will help you to clear your view. There are lots of options currently present on the internet so let’s go one by one to each of them.



Shared hosting :

This is the first step towards hosting or we can say just the beginning of hosting a website if you are new to this area. In this type of hosting your website is hosted on a shared server as its name suggests the factors like storage, bandwidth, and many more are shared among all the clients of that shared server.

Because of this sharing sometimes a problem arises as if someone’s site has large traffic at a specific time then it will slow down your website to load and increases the response time also.
The hosting service provider provides its own system administration. If you belong to the non-technical field, needed less headache for managing your website, and having fewer visitors then shared hosting is one of the best options for you.


 Dedicated hosting :

This hosting type is totally opposite to the shared hosting, in shared hosting where we are sharing the server among all clients in this we are hosting our website in a separate server. All the resources on that server are dedicated to our website use.

In this we are responsible for our server security and its management, we have admin privileges means full access control over the server. Also, a high level of technical expertise is required for the installation and ongoing management of the server. Dedicated hosting is one of the expensive types of hosting services and it is only be chosen if your daily visitors are large enough and having large traffic on the website.

                            


VPS(virtual private server) :

This server is somewhere in the middle of a dedicated server and shared server in the functionality because we have our own server resources but the difference is that the whole server does not belong to us meaning the overall CPU time, memory, and many more resources are shared. Suppose hosting service provider has a server of size 10GB of memory whole but for you, it may reserve 4GB of memory. Resources are divided among the client virtually according to the requested arises by the client.
The resources and our own website are still in the hand of the server provider. There may be a concern of security if any of the servers misconfigure then maybe your website compromises therefore security is less as compared to a dedicated server but much more by the shared server.
This type of hosting gives less control over the server, the service provider is totally responsible for security, maintenance, and administration over our website.


Cloud-based hosting:
This is one of the latest type of hosting where we use the cloud service of any provider. In this, so many servers are presently making the clusters of servers. The resources required for maintaining your website are spread across more than one web server, reducing the chance of any downtime due to server malfunction.
Cloud-based hosting is scalable meaning if your site can grow over time, using as many resources as it requires and you only have to pay for what you need. This allows users to employ as many resources as they need without having to build and maintain their own computing infrastructure.
It’s a hosting solution that works via a network and enables companies to consume computing resources like a utility.


Self-service web hosting :

Self-service hosting means by its name itself, you have to rent a place for your server and storage. The complete web hosting is at your own responsibility. The hardware, software power, bandwidth, cooling, backups, administration are maintained by your self. It is the most expensive type of hosting because all the resources are own by us.
Then comes some of the hosting types which are not so popular but have their own importance.

Colocation web hosting :
When you opt for colocation hosting means you rent a space from a data center of any company. You provide your own server, hardware and they provide physical space, security, internet connectivity, cooling. this directly means we are owning our own server and its software so if any fault comes inside our server then it's our responsibility to replace it and take care of it. So its directly implements that we should only opt for these type of hosting types if we have some technical background or expertise. 


WordPress Hosting :

In this hosting you will get the hosting service inside the Wordpress server means Wordpress subdomain inside it. In clear words, WordPress hosting is a service where the web hosting provider will keep your WordPress installation up-to-date. It is not expensive as shared web hosting, this comes as a great option if you are a beginner to this and want no headache because Wordpress offer vary large number of plugin and themes for your website



Knowing Kali Linux for OSCP

Kali Linux is developed and maintained by the offensive security professional. It is a Debian-based Linux distribution focus at advanced Pen...