Any packets you send to the same machine should go out (and back in) over your loopback interface -- they won't go out over the network. You won't be charged for them.
You can verify this by looking at your routing tables. You don't mention what platform you're using, so I can't give a specific example, but from my laptop:
sveiss@brakiri:~$ route get 192.168.1.1
route to: 192.168.1.1
destination: 192.168.1.1
interface: en1
flags: <UP,HOST,DONE,LLINFO,WASCLONED,IFSCOPE>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 1198
sveiss@brakiri:~$ route get 192.168.1.63
route to: 192.168.1.63
destination: 192.168.1.63
interface: lo0
flags: <UP,HOST,DONE,STATIC>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
49152 49152 0 0 0 0 16384 0
sveiss@brakiri:~$ route get 127.0.0.1
route to: localhost
destination: localhost
interface: lo0
flags: <UP,HOST,DONE,LOCAL>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
49152 49152 0 0 0 0 16384 0
Look at the interface:
lines: traffic to addresses local to the machine (192.168.1.63 and 127.0.01) is sent over lo0
, the loopback interface. Traffic going elsewhere will go out over the network via interface en1
.
Now, for name resolution, you're right that if you use a DNS name for your machine, the DNS query and response might well go outside the local box. The application traffic won't, though: it'll follow the rules in your routing table and use the loopback interface, as described above.
Depending on your OS and configuration (is DNS caching turned on? is the DNS name you're using listed in the local hosts file?) the amount of bandwidth consumed by DNS queries will range from zero to tiny -- orders of magnitude less than the rest of your external traffic.