CSE/ISE 311: Systems Administra5on Networking 2

Similar documents
Domain Name System (or Service) (DNS) Computer Networks Term B10

DNS: Domain Name System

Domain Name System Richard T. B. Ma

CMPE 80N: Introduction to Networking and the Internet

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng.

How To Map Between Ip Address And Name On A Domain Name System (Dns)

The Application Layer: DNS

Names vs. Addresses. Flat vs. Hierarchical Space. Domain Name System (DNS) Computer Networks. Lecture 5: Domain Name System

DNS: Domain Name System

Chapter 2 Application Layer

Domain Name System DNS

DNS and P2P File Sharing

CS 43: Computer Networks Naming and DNS. Kevin Webb Swarthmore College September 17, 2015

Domain Name System (DNS) RFC 1034 RFC

Naming and the DNS. Focus. How do we name hosts etc.? Application Presentation Topics. Session Domain Name System (DNS) /URLs

DNS. Spring 2016 CS 438 Staff 1

Ch 6: Networking Services: NAT, DHCP, DNS, Multicasting

Domain Name System (DNS) Reading: Section in Chapter 9

Ch 6: Networking Services: NAT, DHCP, DNS, Multicasting, NTP

Domain Name System (DNS)

FTP: the file transfer protocol

internet technologies and standards

DATA COMMUNICATOIN NETWORKING

NET0183 Networks and Communications

Domain Name System (DNS)

Internet-Praktikum I Lab 3: DNS

Lecture 2 CS An example of a middleware service: DNS Domain Name System

CS 348: Computer Networks. - DNS; 22 nd Oct Instructor: Sridhar Iyer IIT Bombay

C 1. Last Time. CSE 486/586 Distributed Systems Domain Name System. Review: Causal Ordering. Review: Causally Ordered Multicast.

2.5 DNS The Internet s Directory Service

- Domain Name System -

Domain Name System :49:44 UTC Citrix Systems, Inc. All rights reserved. Terms of Use Trademarks Privacy Statement

Network programming, DNS, and NAT. Copyright University of Illinois CS 241 Staff 1

Motivation. Domain Name System (DNS) Flat Namespace. Hierarchical Namespace

DNS and electronic mail. DNS purposes

Computer Networks & Security 2014/2015

DNS. Computer networks - Administration 1DV202. fredag 30 mars 12

3. The Domain Name Service

DNS Domain Name System

Introduction to Network Operating Systems

TCP/IP Network Essentials. Linux System Administration and IP Services

Application Protocols in the TCP/IP Reference Model

Domain Name System Security

Domain Name System. Heng Sovannarith

Distributed Systems. 09. Naming. Paul Krzyzanowski. Rutgers University. Fall 2015

Application Layer. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross

The Domain Name System

ECE 4321 Computer Networks. Network Programming

Application Protocols in the TCP/IP Reference Model. Application Protocols in the TCP/IP Reference Model. DNS - Concept. DNS - Domain Name System

DNS. The Root Name Servers. DNS Hierarchy. Computer System Security and Management SMD139. Root name server. .se name server. .

Resilient Networking. Overview of DNS Known attacks on DNS Denial-of-Service Cache Poisoning. Securing DNS Split-Split-DNS DNSSEC.

IPv6 support in the DNS

Domain Name System (DNS) Fundamentals

THE MASTER LIST OF DNS TERMINOLOGY. v 2.0

Introduction to DNS CHAPTER 5. In This Chapter

Chapter 23 The Domain Name System (DNS)

Dynamic Host Configuration Protocol (DHCP) 02 NAT and DHCP Tópicos Avançados de Redes

Copyright

THE MASTER LIST OF DNS TERMINOLOGY. First Edition

How do I get to

The Domain Name System

KAREL UCAP DNS AND DHCP CONCEPTS MANUAL MADE BY: KAREL ELEKTRONIK SANAYI ve TICARET A.S. Organize Sanayi Gazneliler Caddesi 10

FTP: the file transfer protocol

The Use of DNS Resource Records

Application-layer protocols

DNS : Domain Name System

Understanding DNS (the Domain Name System)

netkit lab dns Università degli Studi Roma Tre Dipartimento di Informatica e Automazione Computer Networks Research Group Version Author(s)

Local DNS Attack Lab. 1 Lab Overview. 2 Lab Environment. SEED Labs Local DNS Attack Lab 1

Networking Domain Name System

DNS. Computer Networks. Seminar 12

Names & Addresses. Names & Addresses. Names vs. Addresses. Identity. Names vs. Addresses. CS 194: Distributed Systems: Naming

How to Add Domains and DNS Records

Domain Name System (DNS) Session-1: Fundamentals. Ayitey Bulley

Agenda. Network Services. Domain Names. Domain Name. Domain Names Domain Name System Internationalized Domain Names. Domain Names & DNS

IPv6 Support in the DNS. Workshop Name Workshop Location, Date

DNS and BIND. David White

DNS: Domain Names. DNS: Domain Name System. DNS: Root name servers. DNS name servers

DNS Session 4: Delegation and reverse DNS. Joe Abley AfNOG 2006 workshop

CSIS 3230 Computer Networking Principles, Spring 2012 Lab 7 Domain Name System (DNS)

Copyright International Business Machines Corporation All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure

CS244A Review Session Routing and DNS

THE DOMAIN NAME SYSTEM DNS

Computer Networks: Domain Name System

CS3250 Distributed Systems

HTG XROADS NETWORKS. Network Appliance How To Guide: EdgeDNS. How To Guide

Networking Domain Name System

Part 5 DNS Security. SAST01 An Introduction to Information Security Martin Hell Department of Electrical and Information Technology

Introduction to the Domain Name System

Transcription:

Networking 2 Por$ons courtesy Ellen Liu

Outline IP address alloca$on NAT (Network address transla$on) Rou$ng configura$on DHCP (Dynamic host configura$on protocol) DNS (Domain name system) 16-2

IP Address Alloca5on CSE/ISE 311: Systems Administra5on A site can subdivide the address space assigned into subnets in any manner the site likes ICANN (Internet Corp. for Assigned Names & Numbers) delegates address blocks to 5 regional Internet registries ARIN: north America APNIC: Asia Pacific, Australia, New Zealand AfriNIC: Africa LACNIC: Central / south America RIPE NCC: Europe Then na$onal / regional ISPs, 16-3

Background: Private networks Class A: 10.0.0.0 to 10.255.255.255 == 10.0.0.0/8 Class B: 172.16.0.0 to 172.31.255.255 == 172.16.0.0/12 Class C: 192.168.0.0 to 192.168.255.255 == 192.168.0.0/16 No one owns these networks These addresses will not be routed on the internet Good choice to use for a disconnected/private network 16-4

Network address transla$on (NAT) Local network uses just one IP address as seen from outside Router translates all IP addresses on incoming and outgoing packets to internal private addresses Hosts inside local network not explicitly addressable, visible by outside world Mi$gates the IP address shortage problem Most residen$al ISPs only give customers one IP 16-5

NAT (Cont d) 16-6

Why not NAT? If applica$on encodes its IP address in applica$on- level payload Arguably poor design, but the customer is always right I want a service visible on the internet? Example: Run a web server from home Most NAT systems allow sta$c routes I can map port 80 from my router to my web box 16-7

How to configure rou$ng/nat? Any system with 2 network interfaces can serve as a router This is basically what wireless tethering does Here we discuss the basics of doing this on Linux Dedicated boxes tend to have higher performance, energy efficiency (more specialized hardware), and easier UI Even if they use Linux internally 16-8

Network Code Most lower- layer networking code is in the kernel, not in any applica$on. Why? Mostly performance: handle packet aeer an interrupt without a context switch Alterna$ves: TCP/IP Offload: push some of the networking code into specialized hardware device User- level drivers: historically inefficient, newer virtualiza$on HW may improve this 16-9

Network configura$on Linux provides a number of u$li$es that configure the in- kernel networking code ifconfig: bring up a network device, assign an IP address, netmask, etc. route: configure rou$ng tables on the system iptables: configure firewall rules, forwarding between interfaces, NAT, etc. 16-10

Examples CSE/ISE 311: Systems Administra5on Suppose I want to configure a single network card to use IP 192.168.0.2/24 ifconfig eth0 192.168.0.2 netmask 255.255.255.0 Linux generally names network interfaces eth0, eth1, etc. 16-11 Examples adapted from: hgp://how- to.wikia.com/wiki/how_to_set_up_a_nat_router_on_a_linux- based_computer

Example (cont) Now I want to set up a router One network card listening on my private network: 192.168.0.0/24 Another network card on the public network, provided IP address 130.245.153.3 ifconfig eth0 192.168.0.1 netmask 255.255.255.0 ifconfig eth1 130.245.153.3 netmask 255.255.255.0 16-12

Router, cont # route Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 eth0 130.245.153.0 * 255.255.255.0 U 0 0 0 eth1 default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 Packets originating from the router will (mostly) be delivered to the right interface To 192.168.0.* goes to eth0 To 130.245.153.* goes to eth1 Everything else goes to eth0 (the private network) Problems? Router won t send internet traffic to eth1 Router won t forward traffic from eth0 to eth1 (or do translation) 16-13

Default Route If I want to change the default route on the router box: route add default gw 130.245.153.0 gw == gateway (== router) Now packets go to eth1 if they aren t going to either local network 16-14

Set up NAT modprobe iptable_nat echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -A FORWARD -i eth1 -j ACCEPT Pseudo-files in /proc configure the Linux kernel Iptables arguments: -t nat Operate on the nat table -A POSTROUTING Append to rule list (chain) named POSTROUTING -o eth0 The packet is going to eth0 -i eth1 The packet came from eth1 -j MASQUERADE If a packet matches this rule, jump to chain MASQ 16-15

Toward simpler network management In the previous examples, we manually assigned IP addresses What if a machine is powered off? Leaves the network? (laptop) Or just doesn t need to be running any world- visible services? Automa$on would be nice 16-16

DHCP Dynamic host configura$on protocol Link layer protocol. Why? No IP address yet Server keeps a pool of available addresses CSE/ISE 311: Systems Administra5on When adding a new computer on a network, that computer can lease an IP address from server Lease must be renewed periodically (generally daily) When a lease expires, IP address goes back in pool, can be given to another computer 16-17

DHCP Leasable parameters include IP addresses and netmasks Default gateway (router) DNS name servers Syslog hosts, NTP servers, proxy servers, etc. Also handy for pushing other network configura$on to clients PXE implemented using DHCP DHCP server can also assign specific IP addresses to MAC addresses 16-18

DHCP (Cont d) Many wireless routers include DHCP server soeware. There are open source DHCP servers available also. 16-19

Crea$vely named dhcp3 Ubuntu has a new udhcpd Linux DHCP server Generally configured using a file named /etc/dhcpd.conf Places leases in a file called /etc/dhcpd.leases 16-20

Configura$on examples subnet 192.168.1.0 netmask 255.255.255.0 { option routers 192.168.1.254; option subnet-mask 255.255.255.0; option domain-search "example.com"; option domain-name-servers 192.168.1.1; option time-offset -18000; # Eastern Standard Time range 192.168.1.10 192.168.1.100; } Allocates IP addresses between.10 and.100 Pushes the other configuration options to client 16-21

Configura$on example 2 Suppose I want to always assign a given IP and hostname to a machine Why? host apex { option host-name "apex.example.com"; hardware ethernet 00:A0:78:8E:9E:AA; fixed-address 192.168.1.4; } 16-22

DNS: Domain Name System CSE/ISE 311: Systems Administra5on People: many iden$fiers: SSN, name, passport # Internet hosts, routers: IP address (32 bit) - used for addressing datagrams name, e.g., www.yahoo.com - used by humans Q: map between IP addresses and name? Domain Name System: distributed database implemented in hierarchy of many name servers applica3on- layer protocol. Host, routers, name servers communicate to resolve names (address/name transla$on) >100 RFCs, popular implementa$ons: BIND, MS DNS, NSD, Unbound 16-23

DNS DNS services hostname to IP address transla$on host aliasing Canonical, alias names mail server aliasing load distribu$on replicated Web servers: set of IP addresses for one canonical name Why not centralize DNS? single point of failure traffic volume distant centralized database maintenance doesn t scale! 16-24

Root DNS Servers CSE/ISE 311: Systems Administra5on Distributed, Hierarchical Database com TLD servers org TLD servers edu TLD servers yahoo.com DNS servers amazon.com DNS servers redcross.org DNS servers stonybrook.edu DNS servers umass.edu DNS servers Client wants IP for www.amazon.com; 1 st approxima$on: client queries a root server to find com DNS server client queries com DNS server to get amazon.com DNS server client queries amazon.com DNS server to get IP address for www.amazon.com 16-25

DNS: Root name servers contacted by local name servers that can not resolve a name root name server: contacts authorita$ve name server if name not known gets mapping returns mapping to local name server e NASA Mt View, CA f Internet Software C. Palo Alto, CA (and 36 other locations) a Verisign, Dulles, VA c Cogent, Herndon, VA (also LA) d U Maryland College Park, MD g US DoD Vienna, VA h ARL Aberdeen, MD j Verisign, ( 21 locations) k RIPE London (also 16 other locations) i Autonomica, Stockholm (plus 28 other locations) m WIDE Tokyo (also Seoul, Paris, SF) b USC-ISI Marina del Rey, CA l ICANN Los Angeles, CA 13 root name servers worldwide 16-26

TLD and Authorita$ve Servers Top- level domain (TLD) servers: ~20 of them Responsible for generic TLDs (gtlds): com, org, net, edu, gov, mil, etc VeriSign administers the com TLD, Educause for edu TLD And country code domains (cctlds) :~250 of them all top- level country domains uk, fr, ca, jp Authorita$ve DNS servers: organiza$on s DNS servers, providing authorita$ve hostname to IP mappings (called resource records) for organiza$on s servers (e.g., Web, mail). can be maintained by organiza$on or service provider 16-27

Local Name Server does not strictly belong to hierarchy CSE/ISE 311: Systems Administra5on each ISP (residen$al ISP, company, university) has one. also called default name server when host makes DNS query, query is sent to its local DNS server acts as proxy, forwards query into hierarchy 16-28

DNS name resolu$on example Host at cis.poly.edu wants IP address for gaia.cs.umass.edu CSE/ISE 311: Systems Administra5on root DNS server 2 3 TLD DNS server 4 5 iterated query: contacted server replies with name of server to contact I don t know this name, but ask this server local DNS server dns.poly.edu 1 8 reques$ng host cis.poly.edu 7 6 authorita$ve DNS server dns.cs.umass.edu gaia.cs.umass.edu 16-29

DNS name resolu$on example recursive query: puts burden of name resolu$on on contacted name server heavy load? 2 local DNS server dns.poly.edu root DNS server 3 7 6 5 4 TLD DNS server 1 8 reques$ng host cis.poly.edu authorita$ve DNS server dns.cs.umass.edu gaia.cs.umass.edu 16-30

Local vs. Public A local DNS server (i.e., a caching server for your internal network), must support recursive queries Each system s resolver won t do this I wouldn t allow public access to a caching server. Why not? Mostly to prevent denial of service 16-31

Advice for a public DNS server Configure it to not service recursive queries I answer for my domain, and my domain only Again, reduce denial- of- service risk Caching servers can make their own recursive requests Point: you probably want 2 different servers (internal vs. external) 16-32

Resource Records Informa$on about one host in a standardized format Ensures interoperability across implementa$ons Example: map hostname ns to IP 192.168.1.10 ns IN A 192.168.1.10 16-33

Resource Record format [name] [gl] [class] type data ns IN A 192.168.1.10 ns is the host name class IN == internet type A == address (name- >addr. transla$on) 16-34

Other record types Start of Authority (SOA) declare a zone, assert ownership of it Name Server (NS) iden$fy authorita$ve name servers Address (A) name to address Pointer (PTR) address to name Mail Exchanger (MX) mail server CNAME aliases for a host 16-35

FQDN What is it? Fully qualified domain name Eg., mail.cs.stonybrook.edu (vs mail) 16-36

DNS: caching and upda$ng records once (any) name server learns mapping, it caches mapping cache entries $meout (disappear) aeer some $me TLD servers typically cached in local name servers Thus root name servers not oeen visited update/no$fy mechanisms RFC 2136 hgp://datatracker.iez.org/wg/dnsind/charter/ Current IETF DNS working group: hgp://datatracker.iez.org/wg/dnsext/charter/ Many new areas: authen$ca$on and DNSSEC, interna$onaliza$on, IPv6 16-37

DNS records DNS: distributed db storing resource records (RR) RR format: (name, value, type, ttl) CSE/ISE 311: Systems Administra5on Type=A v name is hostname v value is IP address Type=NS name is domain (e.g. foo.com) value is hostname of authorita$ve name server for this domain Type=CNAME v name is alias name for some canonical (the real) name www.ibm.com is really servereast.backup2.ibm.com v value is canonical name Type=MX v value is name of mailserver associated with name 16-38

DNS protocol, messages CSE/ISE 311: Systems Administra5on DNS protocol : query and reply messages, both with same message format msg header iden$fica$on: 16 bit # for query. Reply to query uses same # flags: v query or reply v recursion desired v recursion available v reply is authorita$ve v Non- authorita5ve means the answer of a query is from cache, doesn t know if the data is s$ll valid 16-39

DNS protocol, messages CSE/ISE 311: Systems Administra5on Name, type fields for a query RRs in response to query records for authorita$ve servers addi$onal helpful info that may be used 16-40

Time to live (TTL) Long at the roots (~42 days).edu, stonybrook.edu (~2 days) www.stonybrook.edu (~1 day) Of course, an administrator can set whatever she likes, but these are reasonable defaults 16-41

Unsolicited Advice Get your upstream DNS from google 8.8.8.8 and 8.8.4.4 It is probably faster and more reliable than the caching service your ISP offers 16-42

Linux DNS server: Bind Can run in several modes: Caching upstream DNS records Accelerate local lookups, save bandwidth Primary Master: Answers queries from its local database, acts as master for domain If you register example.com, you need a master for example.com Secondary Master: Repeats answers from a master Mainly needed if primary is overloaded 16-43

Bind configura$on Main abstrac$on: Zone A domain without subdomains Or, a suffix this server is responsible for E.g., example.com running on 192.168.1.0/24 eg.example.com is a different zone You need a forward and reverse zone DNS servers also map IPs back to hostnames A server hosts mul$ple zones Each zone has a file under /etc/bind/ 16-44

Example: Primary Server Add forward and reverse entries to /etc/bind/ named.conf.local zone "example.com" { }; type master; file "/etc/bind/db.example.com"; zone "1.168.192.in-addr.arpa" { type master; file "/etc/bind/db.192"; }; 16-45 hgps://help.ubuntu.com/12.04/serverguide/dns- configura$on.html

Contents of db.example.com ; ; BIND data file for example.com ; $TTL 604800 @ IN SOA example.com. root.example.com. ( ; IN A 192.168.1.10 @ IN NS ns.example.com. @ IN A 192.168.1.10 @ IN AAAA ::1 ns IN A 192.168.1.10 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL 16-46

Contents of db.192 ; ; BIND reverse data file for local loopback interface ; $TTL 604800 @ IN SOA ns.example.com. root.example.com. ( ; @ IN NS ns. 10 IN PTR ns.example.com. ; also list other computers 21 IN PTR box.example.com. 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL 16-47

Linux DNS client configura$on Can be pushed by DHCP Or configured locally in /etc/resolv.conf Or some$mes /etc/resolv.conf is populated by entries in / etc/network/interfaces 16-48

Generally 2 entry types: nameserver 8.8.8.8 resolv.conf search cs.stonybrook.edu stonybrook.edu Nameserver IP of the DNS server to use Generally a caching server Why not a hostname? Search: suffixes to append if you just get a host Auto- map mail to mail.cs.stonybrook.edu 16-49

Trick: Load balancing with DNS There isn t just one web server behind www.google.com Suppose there are 100 servers. How to evenly distribute client load? Each DNS query gets a different answer Round- robin through the different hosts 16-50

Example Round-robin www to.1--.3 www IN A 192.168.0.1 IN A 192.168.0.2 IN A 192.168.0.3 16-51

Ac$ve Directory Next most popular DNS server Aeer BIND Ac$ve Directory also includes a number of other services, including user management You probably want one of these if you are se}ng up a Windows network 16-52

Best prac$ces for external DNS At least 2 authorita$ve servers Each on a separate network and power circuit In other words, have a DNS server off site So your network stays up if someone trips on the power cord to your server rack 16-53

Zone Transfers Protocol by which DNS master updates slave Exchange cryptographically signed messages Why? Keys called TSIG 16-54

An$- Phishing Domain Keys Iden$fied Mail (DKIM) Basically, a mail server can now sign all outgoing messages with a private key Public key distributed through DNS Receiving server checks mail signature against public key Detect mail that claims to come from stonybrook.edu but really isn t 16-55

DNSSEC Big topic: Basically add digital signatures to DNS records Underlying issue: As described, you can t really verify the integrity of any DNS response Idea: Integrate public key crypto to sign each message 16-56

Review of DNS server types Does the server speak for this zone? Authorita$ve vs. caching If authorita$ve, where does it get its informa$on? Master vs. slave Does is say I don t know? Recursive vs. non- recursive 16-57