Name and Address Conversions Chap 11. Domain Name System  A lookup mechanism for translating objects into other objects  A globally distributed, loosely.

Slides:



Advertisements
Similar presentations
Topics: –DNS system –Gathering machine information How to find out the machines ip address, name, OS, version, etc.
Advertisements

CSE 333 – SECTION 8 Networking and sockets. Overview Network Sockets IP addresses and IP address structures in C/C++ DNS – Resolving DNS names Demos.
Sergei Komarov. DNS  Mechanism for IP hostname resolution  Globally distributed database  Hierarchical structure  Comprised of three components.
Domain Name System. DNS is a client/server protocol which provides Name to IP Address Resolution.
1 DNS. 2 BIND DNS –Resolve names to IP address –Resolve IP address to names (reverse DNS) BIND –Berkeley Internet Name Domain system Version 4 is still.
#include DatatypeDescription int8_t uint8_t int16_t uint16_t int32_t uint32_t Signed 8-bit integer Unsigned 8-bit integer Signed 16-bit integer Unsigned.
McGraw-Hill©The McGraw-Hill Companies, Inc., Chapter 25 Domain Name System.
Domain Name System (DNS) Network Information Center (NIC) : HOSTS.TXT.
Application Layer At long last we can ask the question - how does the user interface with the network?
Domain Name System: DNS
1 Advanced Name and Address Conversions getaddrinfo, getnameinfo, gai_strerror, freeaddrinfo host_serv, tcp_connect, tcp_listen, udp_client, udp_connect,
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 5 Introduction to DNS in Windows Server 2008.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 19 Domain Name System (DNS)
25.1 Chapter 25 Domain Name System Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Domain Name System ( DNS )  DNS is the system that provides name to address mapping for the internet.
TCP/IP Protocol Suite 1 Chapter 17 Upon completion you will be able to: Domain Name System: DNS Understand how the DNS is organized Know the domains in.
Presented by Neeta Jain CISC 856 TCP/IP and Upper Layer Protocols RFC 1034 & RFC 1035.
Application Layer. Domain Name System Domain Name System (DNS) Problem – Want to go to but don’t know the IP addresswww.google.com Solution.
DNS Domain Name Service References: Wikipedia 1.
Tony Kombol ITIS Who knows this? Who controls this? DNS!
DNS Domain Name System. Hostnames  IP Addresses are great for computers – IP address includes information used for routing.  IP addresses are tough.
Netprog: DNS and name lookups1 Address Conversion Functions and The Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
Chapter 16 – DNS. DNS Domain Name Service This service allows client machines to resolve computer names (domain names) to IP addresses DNS works at the.
Domain Names System The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the.
Socket Programming. Introduction Sockets are a protocol independent method of creating a connection between processes. Sockets can be either – Connection.
Client-Side Network Programming
Microsoft Windows Server 2003 TCP/IP Protocols and Services Technical Reference Slide: 1 Lesson 17 Domain Name System (DNS)
DNS and C# SWE 344 Internet Protocols & Client Server Programming.
Elementary Name and Address Conversions
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.1 ISP Services Working at a Small-to-Medium Business or ISP – Chapter 7.
25.1 Chapter 25 Domain Name System Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Network Protocols Chapter 25 (Data Communication & Networking Book): Domain Name System (DNS) 1.
Chapter 17 Domain Name System
TCP/IP Protocol Suite 1 Chapter 17 Upon completion you will be able to: Domain Name System: DNS Understand how the DNS is organized Know the domains in.
Domain Name System CH 25 Aseel Alturki
October 8, 2015 University of Tulsa - Center for Information Security Microsoft Windows 2000 DNS October 8, 2015.
Deploying a Web Application Presented By: Muhammad Naveed Date:
Netprog: DNS and name lookups1 Address Conversion Functions and The Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
Internet and Intranet Protocols and Applications Lecture 5 Application Protocols: DNS February 20, 2002 Joseph Conron Computer Science Department New York.
1 Kyung Hee University Chapter 18 Domain Name System.
Domain Name System Refs: Chapter 9 RFC 1034 RFC 1035.
More on Socket API. More on Socket I/O Functions  Scatter read and gather write.
Netprog: Advanced Sockets Programming1 Advanced Sockets Programming Ref: Chapter 7,11,21,22.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 19 Domain Name System (DNS)
TELE 402 Lecture 6: Name and address conversions 1 Overview Last Lecture –Socket Options and elementary UDP sockets This Lecture –Name and address conversions.
Advanced UNIX programming Fall 2002 Instructor: Ashok Srinivasan Lecture 25 Acknowledgements: The syllabus and power point presentations are modified versions.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 18 Domain Name System (DNS)
Domain Name System (DNS)
TCP/IP Protocol Suite 1 Chapter 17 Upon completion you will be able to: Domain Name System: DNS Understand how the DNS is organized Know the domains in.
COMP 431 Internet Services & Protocols
Chapter 11 Advanced Name and Address Conversion. Introduction gethostbyname, gethostbyaddr: protocol dependent getaddrinfo: –a function providing protocol.
Internet Naming Service: DNS* Chapter 5. The Name Space The name space is the structure of the DNS database –An inverted tree with the root node at the.
Basics of the Domain Name System (DNS) By : AMMY- DRISS Mohamed Amine KADDARI Zakaria MAHMOUDI Soufiane Oujda Med I University National College of Applied.
CSE 333 – SECTION 8 Client-Side Network Programming.
Name and Address Conversions
Name/Address conversion:
DNS.
CS 105 “Tour of the Black Holes of Computing”
Working at a Small-to-Medium Business or ISP – Chapter 7
CpSc 360: Distributed and Network Programming
Working at a Small-to-Medium Business or ISP – Chapter 7
Name and Address Conversions Part I
תקשורת ומחשוב תרגול 3-5 סוקטים ב-C.
Working at a Small-to-Medium Business or ISP – Chapter 7
Advanced Sockets Programming
Chapter 11 Name and Address Conversions (Part II)
Chapter 25 Domain Name System
Chapter 25 Domain Name System
DNS : Domain Name System
Domain Name System: DNS
Presentation transcript:

Name and Address Conversions Chap 11

Domain Name System  A lookup mechanism for translating objects into other objects  A globally distributed, loosely coherent, scalable, reliable, dynamic database  Comprised of three components  Name space  Servers making that name space available  Resolvers (clients) which query the servers about the name space

Domain Name Space  DNS's distributed database is indexed by domain names.  Each domain name is essentially just a path in a large inverted tree, called the domain name space.

Domain, Delegation, Zone

Name Server Architecture Master server Zone transfer Zone data file From disk Authoritative Data (primary master and slave zones) Agent (looks up queries on behalf of resolvers) Cache Data (responses from other name servers) Name Server Process

Authoritative Data Resolver Query Response Authoritative Data (primary master and slave zones) Agent (looks up queries on behalf of resolvers) Cache Data (responses from other name servers) Name Server Process

Using Other Name Servers Arbitrary name server Response Resolver Query Authoritative Data (primary master and slave zones) Agent (looks up queries on behalf of resolvers) Cache Data (responses from other name servers) Name Server Process Response

Cached Data Query Response Authoritative Data (primary master and slave zones) Agent (looks up queries on behalf of resolvers) Cache Data (responses from other name servers) Name Server Process Resolver

Name Resolution  A DNS query has three parameters:  A domain name (e.g., ice.hufs.ac.kr),  Remember, every node has a domain name!  A class (e.g., IN), and  A type (e.g., A)  DNS message format Additional Authority Answer Question Header : the question for the name server : RRs answering the question : RRs pointing toward an authority : RRs holding additional information

Mapping Addresses to Names

Resource Records  주요 RRs  SOA Record (Start Of Authority): 해당 도메인에 대해 네임서버가 인증 (authoritative) 된 자료를 갖고 있음을 의미  NS(Name Server) Record: 해당 도메인에 대한 delegation 하는 네임서버를 지시  A Record: 도메인에 IPv4 주소를 mapping  AAAA Record: 도메인에 IPv6 주소를 mapping  CNAME Record: 도메인에 대한 또 다른 이름 설정  MX(Mail eXchanger) Record: 해당 호스트의 메일 라우팅 경로를 조정  PTR(Pointer) Record: IP 주소를 domain name 으로 reverse mapping 해 주며, Reverse Zone 파일에서 사용 NAME (Dynamic) TYPE(2 Byte) CLASS(2 Byte) TTL(4 Byte) RDLENGTH(2 Byte) RDATA(Dynamic)

Name and Address Conversion Functions  Domain name  IPv4 address  IPv4 address  domain name  gethostbyname/gethostbyaddr are not reentrant !! static struct hostent host; /* result stored here */ struct hostent * gethostbyname(const char *hostname) { /* call DNS functions for A or AAAA query */ /* fill in host structure */ return(&host); }

Service Name Conversion Functions  Service name  port ( See /etc/services )  Port  service name

Example: name/daytimetcpcli1.c Network-related information

New Name/Address Conversion Function (1)  hostname : hostname or address string  service : service name or decimal port number string  result : addrinfo data structure is dynamically allocated  Re-entrant, thread-safe, and protocol independent functions (support IPv4, IPv6)

New Name/Address Conversion Function (2)  hints : NULL or pointer to addrinfo data structure  The following member can be set by caller  ai_flag /* AI_PASSIVE for server, AI_CANNONNAME */  ai_family/* AF_xxx */  ai_socktype/* SOCK_xxx */  ai_protocol/* 0 or IPPROTO_xxx for IPv4 and IPv6 */  Example

getaddrinfo Actions and Results

UNP Library Functions #include “unp.h” struct addrinfo *host_serv(const char *hostname, const char *service, int family, int socktype); Returns: pointer to addrinfo structure if OK, NULL on error int tcp_connect(const char *hostname, const char *service); int tcp_listen(const char *hostname, const char *service, socklen_t *lenptr); Both returns: connected socket descriptor if OK, no return on error int udp_client(const char *hostname, const char *service, void **saptr, socklen_t *lenp); Returns: unconnected socket descriptor if OK, no return on error saptr : address of a pointer to a socket address structure that stores destination IP addr/port # for future calls to sendto int udp_connect(const char *hostname, const char *service); Returns: connected socket descriptor if OK, no return on error int udp_server(const char *hostname, const char *service, socklen_t *lenptr); Rerurns: unconnected socket descriptor if OK, no return on error

tcp_connect and tcp_listen Functions

Protocol-indep Daytime TCP Client/Server names/daytimetcpsrv1.cnames/daytimetcpcli.c

Protocol-indep Daytime UDP Client/Server names/daytimeudpsrv2.c names/daytimeudpcli1.c

getnameinfo Function  If the caller does not want to return host ( serv ) string, specify hostlen ( servlen ) of 0  flags