What Is DNS? Explain Working of DNS: HTML XML

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

What is DNS?

Explain working of DNS


DNS stands for domain name system
Each browser communicates with other web browsers through logical internet protocol IP
Basically work of dns is to convert domain names into logical IP addresses so that browsercan load up the web
pages.
Dns server helps people to remember domain names instead of ip addresses
e.g. if we want to search something on google then we need not type ip address of google wesimply type the
domain name i.e. www.google.com
entire dns lookup process happens in the background there is no
interaction between user and dns lookup
(separate jr dns ala fkt tr he description ane diagram draw kr)
working of dns
1. User enters the url into the address bar, then query is received by
dns resolver throughinternet e.g. www.google.com
2. after than dns resolver sends query to dns root name server
3. then root name server gets responded by resolver with new address
which is TLD (means.com)
4. request to tld is being made by resolver
5. tld then sends response using ip address of dns
6. finally resolver fires query to respective dns
7. then that particular ip address it return back to resolver
8. then dns sends response to web browser
9. then browser sends request to that ip address
10. then server of the ip address loads the required web page on the browser
DNS lookup process:
1. Your computer sends a DNS query to a DNS resolver.
2. The DNS resolver forwards the query to a root nameserver.
3. The root nameserver directs the query to a TLD nameserver.
4. The TLD nameserver redirects the query to an authoritative nameserver.
5. The authoritative nameserver provides the IP address for the domain name.
6. The DNS resolver caches the IP address and returns it to your computer.
7. Your computer uses the IP address to connect to the web server.
8. The web server sends the website to your computer.
9. Your computer displays the website in your web browser.

HTML XML
It was written in 1993. It was released in 1996.
HTML stands for Hyper Text Markup Language. XML stands for Extensible Markup Language.
HTML is static in nature. XML is dynamic in nature.
It was developed by WHATWG. It was developed by Worldwide Web Consortium.
It is termed as a presentation language. It is neither termed as a presentation nor a programming
language.
HTML is a markup language. XML provides a framework to define markup languages.
HTML can ignore small errors. XML does not allow errors.
It has an extension of .html and .htm It has an extension of .xml
HTML is not Case sensitive. XML is Case sensitive.
HTML tags are predefined tags. XML tags are user-defined tags.
There are limited number of tags in HTML. XML tags are extensible.
HTML does not preserve white spaces. White space can be preserved in XML.
HTML tags are used for displaying the data. XML tags are used for describing the data not for
displaying.
In HTML, closing tags are not necessary. In XML, closing tags are necessary.
HTML is used to display the data. XML is used to store data.
HTML does not carry data it just displays it. XML carries the data to and from the database.
HTML offers native object support. IN XML, the objects are expressed by conventions using
attributes.
HTML document size is relatively small. XML document size is relatively large as the approach of
formatting and the codes both are lengthy.
An additional application is not required for parsing of DOM(Document Object Model) is required for parsing
JavaScript code into the HTML document. JavaScript codes and mapping of text.
SSL TLS
SSL stands for Secure Socket Layer. TLS stands for Transport Layer Security.
SSL (Secure Socket Layer) supports TLS (Transport Layer Security) does not support
the Fortezza algorithm. the Fortezza algorithm.
SSL (Secure Socket Layer) is the 3.0 version. TLS (Transport Layer Security) is the 1.0 version.
In SSL( Secure Socket Layer), the Message digest is In TLS(Transport Layer Security), a Pseudo-random function
used to create a master secret. is used to create a master secret.
In SSL( Secure Socket Layer), the Message In TLS(Transport Layer Security), Hashed Message
Authentication Code protocol is used. Authentication Code protocol is used.
SSL (Secure Socket Layer) is more complex than TLS (Transport Layer Security) is simple.
TLS(Transport Layer Security).
SSL (Secure Socket Layer) is less secured as TLS (Transport Layer Security) provides high security.
compared to TLS(Transport Layer Security).
SSL is less reliable and slower. TLS is highly reliable and upgraded. It provides less latency.
SSL has been depreciated. TLS is still widely used.
SSL uses port to set up explicit connection. TLS uses protocol to set up implicit connection

URI URL
URI is an acronym for Uniform Resource Identifier. URL is an acronym for Uniform Resource Locator.
URI contains two subsets, URN, which tell the name, and URL is the subset of URI, which tells the only location of
URL, which tells the location. the resource.
All URIs cannot be URLs, as they can tell either name or All URLs are URIs, as every URL can only contain the
location. location.
A URI aims to identify a resource and differentiate it from A URL aims to find the location or address of a resource
other resources by using the name of the resource or location on the web.
of the resource.
An example of a URI can be ISBN 0-486-35557-4. An example of an URL is https://www.javatpoint.com.
It is commonly used in XML and tag library files such as It is mainly used to search the webpages on the internet.
JSTL and XSTL to identify the resources and binaries.
The URI scheme can be protocol, designation, specification, The scheme of URL is usually a protocol such as HTTP,
or anything. HTTPS, FTP, etc.

DOM
Dom stands for document object model
With the help of DOM elements can be accessed as well as changed using JS document
Whenever a web page is loaded, browser automatically creates a DOM of that web page
Dom allows user to use JS dynamically
DOM in nothing but W3C(world wide web
consortium) standardIn DOM every element is defined
as objects
Each object has properties as well as standardsDOM is
divided into 3 different parts-
1. Core DOM- it supports all documents
2. XML DOM- it supports only xml documents
3 HTML DOM- it supports only html documentsFeatures
OF DOM-
1. Dynamically change all html elements
2. Change all css styles
3. Interact with all html events
4. Create new html event

Methods of DOM-
1. getElementbyId()
2. getElementsByTagName()
3. createElement() 5. removeChild() 7. getAttribute()
4. appendChild() 6. node() 8. setAttribute()
Keyword Description Example
var Declares a variable with function-level scope. var message = "Hello!";
let Declares a variable with block-level scope. let message = "Welcome!";
const Declares a constant variable whose value cannot be changed. const message = "Goodbye!";

var let const


The scope of a var variable is The scope of a let variable is block The scope of a const variable is block scope.
functional scope. scope.
It can be updated and re- It can be updated but cannot be re- It cannot be updated or re-declared into the
declared into the scope. declared into the scope. scope.
It can be declared without It can be declared without It cannot be declared without initialization.
initialization. initialization.
It can be accessed without It cannot be accessed without It cannot be accessed without initialization,
initialization as its default initialization otherwise it will give as it cannot be declared without
value is “undefined”. ‘referenceError’. initialization.
hoisting done, with initializing Hoisting is done, but not initialized Hoisting is done, but not initialized (this is
as ‘default’ value (this is the reason for the error when the reason for the error when we access the
we access the let variable before const variable before
declaration/initialization declaration/initialization

Loops are a fundamental programming concept that allows you to repeat a block of code multiple times. They are used in
various situations, such as iterating over arrays, processing data, and generating sequences.
Types of Loops in JavaScript
JavaScript offers several types of loops, each suited for different scenarios:
1. for loop: The most common loop type, used to execute a block of code a fixed number of times.
JavaScript
for (let i = 0; i < 5; i++) {
console.log(i); // Output: 0, 1, 2, 3, 4
}

2. for...in loop: Used to iterate over the properties of an object.


JavaScript
const person = { name: "John", age: 30, city: "New York" };
for (const property in person) {
console.log(property + ": " + person[property]);
// Output: name: John, age: 30, city: New York
}
3. for...of loop: Used to iterate over the values of an iterable object, such as an array or a string.
JavaScript
const numbers = [1, 2, 3, 4, 5];
for (const number of numbers) {
console.log(number); // Output: 1, 2, 3, 4, 5
}
4. while loop: Used to execute a block of code repeatedly as long as a condition is true.
JavaScript
let i = 0;
while (i < 5) {
console.log(i); // Output: 0, 1, 2, 3, 4
i++;
}
5. do...while loop: Similar to the while loop, but the code block is executed at least once before checking the condition.
JavaScript
let i = 0;
do {
console.log(i); // Output: 0
i++;
} while (i < 5);
React component:
A component is considered as building block of react It merges all components in parent component to make a
application final UI of your application
It makes task of building UI much faster Every react component has its own structure, methods
Each component exists in same space but they work as well as API
independently from each other Root is the starting component of any react application
Types of components:
1. Functional components 2. Class components

Functional components
It contains only render method It is also known as stateless component because they do
Does not have their own state not hold or manage state
Does not receive any data as parameter
e.g.
import React from 'react';
const Greeting = () => {
return <h1>Hello, React!</h1>;};
export default Greeting;

Class component
More complex than functional components It is stateful component
It requires to extends from react.component and create They can hold and manage states
render function which returns react element
e.g. import React, { Component } from 'react';
class Greeting extends Component {
render() {
return <h1>Hello, React Class Component!</h1>;
}}
export default Greeting;

React component lifecycle


• React web apps are collection of independent components that runs according to interactions with them
• Every react component has its own lifecycle
• Lifecycle can be defined as series of methods
• React provides developers with set of predefined functions that if they are invoked around specific event in their lifecycle
• Component lifecycle of react has 4 stages-
1. Initialization
2. Mounting
3. Updating
4. Unmounting
Initialization-
In this phase component is
constructed
This is done in the constructor of
component class
Mounting-
It is stage of rendering JSX return by
render method
Updating-
In this stage state of component can
be updated or application can be
repainted
Unmounting-
It is final stage of component
lifecycle
In this phase component is removed
from the page

You might also like